PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Code: Select all
$query="SELECT max( id ) as maxnum FROM `tbl_customer`";
$result=mysql_query($query);
$row = mysql_fetch_array($result);
$myid=$row[maxnum];
returns null/zero. If it is null/zero i.e. no records in tbl_customer then i want id to be 1 else start from 1+id.