RE: auto_increment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



One of two things comes to my mind:

1.) auto_increment *might* have to be AUTO_INCREMENT, as that is how the
manual states it and *some* things in MySQL are case-sensitive (such as
table names).

2.) Make sure you have satisfied the following (From the MySQL manual):
--
You cannot reset the counter to a value less than or equal to any that
have already been used. For MyISAM, if the value is less than or equal
to the maximum value currently in the AUTO_INCREMENT column, the value
is reset to the current maximum plus one. For InnoDB, you can use ALTER
TABLE ... AUTO_INCREMENT = value as of MySQL 5.0.3, but if the value is
less than the current maximum value in the column, no error message is
given and the current sequence value is not changed.
--

If neither of these help, the actual error message may be of use.

-Logan

-----Original Message-----
From: Ron Piggott [mailto:ron.php@xxxxxxxxxxxxxxxxxx] 
Sent: Friday, April 13, 2007 10:04 PM
To: PHP DB
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();

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux