Trying to get last row from a database, but when the table is new and no row is entered, it return error.
$lastrow="select ID from $sectionN order by ID desc limit 1";
$lastrow=mysql_query($lastrow);
echo $lastrow;
$lastrow=mysql_result($lastrow,0) + 1;
How to fix that so that even if the table is new it return last row (I mean first row in this case)