ALTER TABLE table1 AUTO_INCREMENT = 500
On Monday, July 29, 2002, at 10:44 PM, [EMAIL PROTECTED] wrote:
> my primary key column ("id") is set to auto_increment as usual which is
> handy. But when I delete a row, the auto_increment just keeps
> and there's this 'hole' left where I deleted the row!
> Apart from this looking ugly, it poses another problem. In my PHP script
> where I can add new rows, I query the table, checking how many rows in
> table altogether and set the new id as the next number, but this doesnt
> if theres 'holes' in the id field, as the new record tries to overwrite
> another id.
> So I've 2 questions
> 1) Can the next auto_increment value be 'set' by a SQL query????
> 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in
> the ID
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php