RE: how can reset value of auto_increment field

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

 



> i am develop a site, my database have data, when i delete all data and
> insert
> new data the auto_increment field continue with the old value ( befor
> delete)
> 
> so , how can i use alert command via php .

You mean ALTER? Same way as you use SELECT, UPDATE and any other SQL
statement. 

First of all, there is no need to do this. Second, if you insist, use:

ALTER TABLE <table_name> AUTO_INCREMENT = 1

To reset the auto_increment counter back to one. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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