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;
}