I have some code that is supposed to be taking the last highest number and adding 1 to it. Problem is, it isn't working correctly. It is separate from the Primary key because the Owner ID is up to 6 numbers.
Here is the code that I am using.
$result_ownerid = mysql_query("SELECT MAX(OwnerID)+1 AS newOwnerID FROM Owners",$connection) or die(mysql_error());
//echo $newOwnerID; //for testing
;
$row = mysql_fetch_array($result_ownerid);
$newOwnerID = $row["newOwnerID"];
Then later in the code it is supposed to echo the next available number
<input name="OwnerID" type="text" class="blue" value="<?php echo $newOwnerID ?>" size="15" maxlength="12">
Any ideas why it isn't showing the next highest number?
TIA