At 03:04 14/04/2007, you wrote:
From: Ron Piggott <ron.php@xxxxxxxxxxxxxxxxxx>
Reply-To: ron.php@xxxxxxxxxxxxxxxxxx
To: PHP DB <php-db@xxxxxxxxxxxxx>
Content-Type: multipart/alternative; boundary="=-xK5L7HjLIUaeMS/bzYQr"
Date: Fri, 13 Apr 2007 22:03:59 -0400
Message-Id: <1176516241.32635.118.camel@xxxxxxxxxxxxxxxxxxxxx>
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php