Re: Subject: auto_increment
am 15.04.2007 12:57:53 von Neil SmthAt 03:04 14/04/2007, you wrote:
>From: Ron Piggott
>Reply-To: ron.php@actsministries.org
>To: PHP DB
>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.
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php