Re: Subject: auto_increment

From: Date: Sun, 15 Apr 2007 10:57:53 +0000
Subject: Re: Subject: auto_increment
Groups: php.db 
Request: Send a blank email to php-db+get-43445@lists.php.net to get a copy of this message
At 03:04 14/04/2007, you wrote:
From: Ron Piggott <ron.php@actsministries.org> Reply-To: ron.php@actsministries.org To: PHP DB <php-db@lists.php.net> Content-Type: multipart/alternative; boundary="=-xK5L7HjLIUaeMS/bzYQr" Date: Fri, 13 Apr 2007 22:03:59 -0400 Message-Id: <1176516241.32635.118.camel@localhost.localdomain> Mime-Version: 1.0 Subject: auto_increment Does anyone see anything wrong with the $query syntax? Ron mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="ALTER TABLE sessions auto_increment = '1'"; mysql_query($query); mysql_close();
Is "sessions" table supposed to have a column which is auto increment ? That column must be a PRIMARY KEY for autoincrement to be applied. <sighs>Though as-ever you haven't posted the error message</sighs> presumably you haven't got a PK yet. Since we don't magically know your table structure since you didn't post that either, it's kind of hard to tell. Ron - in future please could I ask you to post both table structure and error message, when asking "what's wrong" ? Cheers - Neil

« previous php.db (#43445) next »