Hi Rudy,
Thanks for the advice; I had not come across the INSERT IGNORE command so that's massively useful. Here is my code (minus error messages):-
PHP Code:
$sql = "INSERT IGNORE INTO theatre SET
theatre_name='$theatre_name',
theatre_created=NOW(),
theatre_updated=NOW()";
$theatreid = mysqli_insert_id($link); //OBTAINS NEWLY ACQUIRED theatre_id
$sql = "INSERT INTO prodtheatre SET
prodid='$prodid',
theatreid='$theatreid'";
Might you be able to explain how to use the SELECT command to retrieve and insert the 'theatre_id' data (from pre-existing or newly-created entries in the 'theatre' table) into the 'theatreid' field (of the 'prodtheatre' table)?
Thanks (I'm still a beginner)!
Andy
Bookmarks