Re: quicky sql question

From: Date: Thu, 21 Dec 2000 05:50:36 +0000
Subject: Re: quicky sql question
Groups: php.general 
Request: Send a blank email to php-general+get-31363@lists.php.net to get a copy of this message
Addressed to: php3@developersdesk.com Marc Davenport <md261897@oak.cats.ohiou.edu> php-general@lists.php.net ** Reply to note from php3@developersdesk.com Wed, 20 Dec 2000 22:46:17 MST Addressed to: Marc Davenport <md261897@oak.cats.ohiou.edu> php-general@lists.php.net ** Reply to note from Marc Davenport <md261897@oak.cats.ohiou.edu> Wed, 20 = Dec 2000 23:26:26 -0500 (EST) > > Here is a quick one someone can answer > > What is wrong with this SQL query > > INSERT INTO com_site SET (UID='' , ACTIVE='1' , TITLE='test') > > UID is NOT NULL, but it is set to AUTO_INCREMENT and I am using a > version of mysql that accepts the SET structure. I've been looking at > it a couple minutes, but I dont see the problem. Its probably really > easy. Oops, lets try that again... Do not include the Auto_Increment value when inserting, and don't use () with SET: INSERT INTO com_site SET ACTIVE='1' , TITLE='test' Unless you want to set a specific value, which in almost all cases you don't. Rick Widmer Internet Marketing Specialists http://www.developersdesk.com

« previous php.general (#31363) next »