Skip to content

Instantly share code, notes, and snippets.

@jimmy89Li
Last active February 23, 2017 13:18
Show Gist options
  • Save jimmy89Li/b79e08456a13b34ff0e0cc844bec49ed to your computer and use it in GitHub Desktop.
Save jimmy89Li/b79e08456a13b34ff0e0cc844bec49ed to your computer and use it in GitHub Desktop.
Insert sql into multiple tables in the same time
$sql = "BEGIN TRANSACTION;";
$sql .= "INSERT INTO table1 (name1) VALUES (value1);";
$sql .= "INSERT INTO table2 (name2) VALUES (value2);";
$sql .= "COMMIT;";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment