> mysql_insert_id() is a PHP function, not a MYSQL function. You are also
> missing a close quote on your insert string. So you have to do it like
> this:
Correct, but LAST_INSERT_ID() is a MySQL function which is what he's
using...
> $sql2 = "insert into acl (adminId,transportId,securityId
mysql_insert_id() is a PHP function, not a MYSQL function. You are also
missing a close quote on your insert string. So you have to do it like
this:
$sql2 = "insert into acl (adminId,transportId,securityId) values
('$userid',".last_insert_id().",'1')";
Notice the "string".function()."string" -
Hi-
I am trying to insert information into mysql based with the sql queries
below. When I run this insert from the mysql console everything works
correct, however, when I run this through php the second sql query doesn't
execute (I'm assuming there is a problem with the last_insert_id()).
I have