I’m very new to php mysql
I want to use one sql query to insert data to two tables is this possible?
the code im using is below:
firstly this test code was run in phpmyadmin and it works fine.
INSERT INTO clients (
(null, ‘’, ‘’, ‘Sam’, ‘ORANGE’, ‘1978-04-21’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘0’, ‘0’, NULL, NULL, NULL, NULL, 3);
INSERT INTO insurance (
and then I tried to use the following code to do the same from php using a form:
$sql= "INSERT INTO clients SET title='$title', seating='$seating', firstname='$firstname', homenumber='$homenumber', surname='$surname', worknumber='$worknumber', birthdate='$birthdate', mobilenumber='$mobilenumber', address1='$address1', address2='$address2', city='$city', postcode='$postcode', accident_id='$caseid'"; "INSERT INTO insurance SET covertype='$cover', clients_id= LAST_INSERT_ID()";
and it fails
any pointers or help would be much appreciated