rogerzebra
Technical User
I'm back with new problems. (I wish I was in the other end
So anyway here it goes.
I'm trying to use the last_insert_id function in order for me to make a copy of the id in t1 and insert it in t2. By this point I'm not sure if my query is incorrect or if it is something else I should change to have this working. When I execute a submission it's register an auto_increment id as it should in t1. If I direct after that run a SELECT LAST_INSERT_ID()query in Mysql, the result gives me a 0. Does anyone know what's wrong here? I'm using InnoDB tables with MySQL version 4.1.7 and beneth is my query.
I'm greatful and open for any suggestions.
Thanks
So anyway here it goes.
I'm trying to use the last_insert_id function in order for me to make a copy of the id in t1 and insert it in t2. By this point I'm not sure if my query is incorrect or if it is something else I should change to have this working. When I execute a submission it's register an auto_increment id as it should in t1. If I direct after that run a SELECT LAST_INSERT_ID()query in Mysql, the result gives me a 0. Does anyone know what's wrong here? I'm using InnoDB tables with MySQL version 4.1.7 and beneth is my query.
Code:
$query= mysql_query("INSERT INTO submissions (NameInsured,..)
VALUES ('$NameInsured',..., )")
or die (mysql_error());
$query= mysql_query("INSERT INTO test SET EvaluationID=SubmissionID WHERE SubmissionID=LAST_INSERT_ID()")
I'm greatful and open for any suggestions.
Thanks