easy question about autoindex in mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ozzsta
Forum Newbie
Posts: 1
Joined: Fri Aug 01, 2003 6:57 am

easy question about autoindex in mysql

Post by ozzsta »

I reckon this will be an easy one.

I have mysql running under apache on my computer (using php triad).

I have a table and have accidentally entered more records and needed to delete them. I need the id to corelate exactly with the amount entered, i know it isn't good standard but once the stuff is in there nothings going to need changing.

now the rows in my table are illustrated like this by phpmyadmin

Row Statistic :

Format dynamic
Rows 62
Row length ø 165
Row size ø 646 Bytes
Next Autoindex 70

how do i get the autoindex back to matching the rows?

please help me :D.
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

I THINK if you pack the table it will reset it, otherwise, delete the column and add it again. Why don't you put the value in intead of using auto_increment?

Code: Select all

<?php
select max(id)+1 as nextId from ...
?>
Post Reply