insert where
am 11.06.2007 04:12:00 von lektrikpukeWhat is wrong with the below?
$sql=mysql_query("INSERT INTO advertiser_tbl WHERE adv_id='7' (adv_name,
cont_name)
VALUES ('Peter', 'Griffin')");
What is wrong with the below?
$sql=mysql_query("INSERT INTO advertiser_tbl WHERE adv_id='7' (adv_name,
cont_name)
VALUES ('Peter', 'Griffin')");
On 11 Jun, 03:12, "Mr. Newt"
> What is wrong with the below?
>
> $sql=mysql_query("INSERT INTO advertiser_tbl WHERE adv_id='7' (adv_name,
> cont_name)
> VALUES ('Peter', 'Griffin')");
It doesn't match any of the valied syntaxes as shown in the manual:
http://dev.mysql.com/doc/refman/5.0/en/insert.html
Post removed (X-No-Archive: yes)
Tom wrote:
> On Sun, 10 Jun 2007 22:12:00 -0400, Mr. Newt wrote...
>> What is wrong with the below?
>>
>> $sql=mysql_query("INSERT INTO advertiser_tbl WHERE adv_id='7' (adv_name,
>> cont_name)
>> VALUES ('Peter', 'Griffin')");
>>
>>
>
> The syntax for the INSERT and UPDATE SQL command are a bit different. An INSERT
> is a new entry so there can't be a conditional clause at the end. The syntax for
> that might be...
>
> INSERT INTO advertiser_tbl (adv_name, cont_name)
> VALUES ('Peter', 'Griffin')");
>
>
> For an UPDATE you could use..
>
> UPDATE advertiser_tbl
> SET adv_name='Peter', cont_name='Griffin'
> WHERE adv_id='7';
>
>
> Tom
Thank you. =)