[Solved] ID of last inserted record.
Posted: Mon Oct 23, 2006 10:41 am
I suppose I can't keep on saying: "I'm new, please excuse me.... bla bla bla."
Obviously I am doing this wrong. Could someone enlighten me please. Simple thing. I need to know the ID (autoincrement field) of the last inserted record. I'm connected succesfully, and have obtained all the relevant values:
Thanks a lot.
Obviously I am doing this wrong. Could someone enlighten me please. Simple thing. I need to know the ID (autoincrement field) of the last inserted record. I'm connected succesfully, and have obtained all the relevant values:
Code: Select all
//Skryf data.
$SQL = "INSERT INTO STEMBUS VALUES ('','$titel', '$kategorie', '$DATUM', '$opsie1', '1', '$opsie2', '0', '$opsie3', '0', '$opsie4', '0', '$opsie5', '0', '$beskrywing', '$verwysing', '$AFFILIATE')";
$RESULT = mysql_query($SQL);
$LAST_ID = mysql_insert_id($RESULT);
if (!$RESULT)
{
echo "<p><font face='Verdana' size='2'>Data kon nie geskryf word nie.</font></p>" . mysql_error();
exit;
}