|
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
[Back to original message]
|