Is it possible to update the AUTO_INCREMENT value who's attributes are primary key, not null, auto increment and also an INT type
The thing is I need to synchronize the 'image_id' to access images sequentially
and if one row is deleted the sequence is destroyed Help me!
<?php
include('db_conexn.php');
$data = mysql_query("SELECT image_id FROM imagetable")
or die(mysql_error());
while($info = mysql_fetch_array( $data )) {
echo $id += 1;
echo " - ".$info['image_id'];
$sync=mysql_query("UPDATE imagetable SET image_id = $id");
echo "<BR>";
}
echo " - <BR> " . $id +=1;
$autoinc = mysql_query("ALTER TABLE imagetable AUTO_INCREMENT = $id");
?>