Re: quicky sql question

From: Date: Thu, 21 Dec 2000 05:46:17 +0000
Subject: Re: quicky sql question
Groups: php.general 
Request: Send a blank email to php-general+get-31361@lists.php.net to get a copy of this message
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. Do not include the Auto_Increment value when inserting: 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 (#31361) next »