How do I make a sql statement to get the last inputted record.
$sql = "SELECT R_ID FROM REVIEW WHERE ID = '?'";
Where ID is an autonumber field in the review table? Thanks...
mysql_insert_id
this appears to work, is this right?
$sql = "SELECT ASP_ID FROM PROVIDER WHERE ASP_ID = ". mysql_insert_id();
looks right to me (assuming you're executing the $sql variable) 😉
If you're just trying to get the last ID, you don't need an extra SQL statement...
$sql = 'INSERT INTO PROVIDER ....'; $exec = mysql_query($sql); echo 'New ID: ' . mysql_insert_id();