RE: [PHP-DB] Multiply Auto_Increments

From: Date: Wed, 13 Nov 2002 19:23:07 +0000
Subject: RE: [PHP-DB] Multiply Auto_Increments
Groups: php.db 
Request: Send a blank email to php-db+get-23304@lists.php.net to get a copy of this message
Looking at the code you've pasted in below, I don't see anything that would result in one valid row plus additional blank rows. Is the code you supplied in a script with any control structures like IF, WHILE, or FOR? Is it included into a script in the middle of a control structure? If you answered yes to any of the above questions, is it supposed to be? Have you closed those control structures prior to executing the INSERT? If there is more code in the script, can you please paste it all? It's possitble something else higher up in the script is causing the problem. Sorry I wasn't more specific the first time. Rich > -----Original Message----- > From: Toby Parkins [mailto:toby@uknetweb.com] > Sent: Wednesday, November 13, 2002 2:16 PM > To: php-db@lists.php.net > Subject: RE: [PHP-DB] Multiply Auto_Increments > > > Richard, > > Here is the code > > $sql = " > INSERT INTO $table > (id,date,user,title,brief,body,expires,visible) > > > VALUES(NULL,\"$date\",\"$user\",\"$title\",\"$brief\",\"$body\ > ",\"$exdate\", > \"1\") > "; > > $connection = mysql_connect($dbhost, $dbusername, > $dbpass) or die ("Could > not connect to database"); > $db = mysql_select_db($dbname) or die ("could not select db."); > $result = mysql_query($sql,$connection) or die ("Could > not execute query"); > > The variables $date etc are from a POST form input > > Any ideas? > > Toby > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#23304) next »