Forum Moderators: coopster
DELETE FROM TABLE (tbl_name) where order_Number = X; will not reset the counter even if the table is empty
you could do it this way ....
SELECT last_insert_id() from tbl_name; gives the last value of counter ie 999
TRUNCATE TABLE (tbl_name); empties the table and resets the counter to 0
ALTER TABLE tbl_name AUTO_INCREMENT = 999; will set the counter to 999
Edit: How about this:
$sql = "SELECT LAST_INSERT_ID() FROM customerMaster";
$reference = mysql_Query($sql);
$reference = $reference++;
$sql = "ALTER TABLE customerMaster AUTO_INCREMENT = $reference";
mysql_Query($sql);