Skip to content

Instantly share code, notes, and snippets.

@nobodyplace
Created May 31, 2011 05:53
Show Gist options
  • Save nobodyplace/1000035 to your computer and use it in GitHub Desktop.
Save nobodyplace/1000035 to your computer and use it in GitHub Desktop.
$sql_values = array();
foreach($data as $line):
$sql_values[] = "(" . $line['id'] . ", '" . $line['date'] . "')";
endforeach;
$sql = "INSERT INTO sample (id, date) VALUES " . implode(', ', $sql_values);
$pdo->query($sql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment