I have the following php code:
$query = "INSERT INTO flashcards VALUES (null, '".$_POST['front0']."', '".$_POST['back0']."', ".$link.", ".$details.", NOW());
INSERT INTO bundleflashcardlink VALUES (null, ".$flashcardbundleid.", LAST_INSERT_ID());";
$result = mysql_query($query);
which gives me the following error:
DB Connection error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO bundleflashcardlink VALUES (null, 37, LAST_INSERT_ID())' at line 2
When I put the following into phpmyadmin it executes properly:
INSERT INTO flashcards VALUES (null, 'front', 'back', 'link', 'details', NOW());# Affected rows: 1
INSERT INTO bundleflashcardlink VALUES (null, 37, LAST_INSERT_ID());# Affected rows: 1
I'm kinda a newb at php so any help would be appreciated. Also is there a better way to formulate the $query string than using concatenation operators to throw in the php variables?
Thanks