I'm trying to insert multiple data in one table, however I got an error that says:
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 author (firstname, lastname) VALUES ('Rasmus', 'Lerdorf')INSERT INT' at line 1
Here's the method:
$sql = "INSERT INTO author (firstname, lastname) VALUES ('Roal', 'Dahl')";
$sql .= "INSERT INTO author (firstname, lastname) VALUES ('Rasmus', 'Lerdorf')";
$sql .= "INSERT INTO author (firstname, lastname) VALUES ('Jane', 'Doe')";
Do I need to create a for loop for this? How could this work?