Hi, Im trying to use this code to get the last number used under "id" say 5300
and use that number +1 everytime. This code should pull the last used number and increase it by 1, but prety much I need to get $id to use the corrrect new number
$query="SELECT `id` FROM `customers`";
$result=mysql_query($query);
$num=mysql_numrows($result);
$id=$num;
while ($id < $num) {
$id++;
};
//Rest of the code, the code above is the problem
$sql4 = "INSERT INTO customers VALUES('$id','$name','$phone','$alt','$address','$city','$state','$zip')";
$result4 = mysql_query($sql4);
if (!$result4) {
die('Invalid query: '.mysql_error());
}