$SQL = "INSERT INTO primarySkills (primaryName) VALUES $surveySQL";
$result = mysql_query($SQL) or die ('Cannot execute query...'.$SQL);
$surveyID = mysql_insert_id($result);
The above code will enter the table data correctly (primaryID, primaryName) but not return the id
generated using mysql_insert_id()
. Please let me know why the id
is not returned?
What is really odd is that I use this function twice before in the same script for different tables and it works there. I double checked that primaryID is auto_increment and a primary key.
Blessings!