I am inserting a record and i want to use the id of the last record inserted. This is what i have tried:
$sql =
\'INSERT INTO customer
(first_name,
You can do another query:
$last_id = "SELECT LAST_INSERT_ID()";
Or try to add ;
in your query:
INSERT INTO customer
(first_name,
last_name,
email,
password,
date_created,
dob,
gender,
customer_type)
VALUES(:first_name,
:last_name,
:email,
:password,
:date_created,
:dob,
:gender,
:customer_type);' . ' SELECT LAST_INSERT_ID()';