Re: auto_increment

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

 



Ron Piggott wrote:

> 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();
The value would be an integer, not a string but that shouldn't cause a
problem. To quote the docs:

ALTER TABLE t2 AUTO_INCREMENT = value;

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.

It probably should be said that there is normally no reason to play with
auto-increment values.



Cheers
-- 
David Robley

An ulcer is what you get mountain climbing over molehills.
Today is Prickle-Prickle, the 31st day of Discord in the YOLD 3173. 

-- 
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