Reply to Re: insert where

Your name:

Reply:


Posted by Tom on 06/11/07 18:39

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
--
Basic Accounts $5.95 / month or $39.95 / 12 months
http://newsguy.com/overview.htm

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация