You are here: Re: no insert ... « PHP Programming Language « IT news, forums, messages
Re: no insert ...

Posted by Rik on 12/17/06 23:53

Ivαn Sαnchez Ortega wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mark Knochen wrote:
>
>> $insert = mysql_query("INSERT INTO $table (textID,redaktion) VALUES
>> ('$_POST[ID]','$row_startseiten[ID]')");
>>
>> I get no mysql_error, if i copy the insert directly into phpmyadmin,
>> the insert works. but with the php-script the insert doesn`t
>> create a new
>> row in the table .. but why?
>
> Because of how the variable expansion works. do an echo() of that
> double-quoted string when running your script, and you'll see the
> error clearly.
>
> So, please RTFM, on the "Data types: string" chapter. And learn to
> use curly braces when putting variables inside a double-quoted string.

And always, always, always * quote array keys (unless you use a variable
offcourse).




* always = if you feel like it
always, always = most of the time
always, always, always = 99,9% of the time.

At least, that seems to be the way people percieve it.
--
Rik Wasmus

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация