Forum Moderators: coopster
example (in a perfect world!)
existing ID is 1, so we know that the next will be 2
eample (in my scenario)
existing ID could be 5, then a few more rows were added, say 6 to 10
but then later 6 to 10 are deleted
so one may think that the next ID could be 6 since the last row reads 5
but as we know the very next will start above the last deleted row
and the new ID will become 11
Question:
Is there a way to figure it out before that last newer row will be added?
I do not want to fillback, just need to fwrite the next id before its creation
Thanks
mysql_connect("localhost","root","");
$result = mysql_query("SHOW TABLE STATUS FROM test;");
while($array = mysql_fetch_array($result)) {
$total = $array[Data_length]+$array[Index_length];
echo '
Table: '.$array[Name].'<br />
Next ID: '.$array[Auto_increment].'<br />
Index Size: '.$array[Index_length].'<br />
Total Size: '.$total.'<br />
Total Rows: '.$array[Rows].'<br />
Average Size Per Row: '.$array[Avg_row_length].'<br /><br />
';
}
// etc....
?>