Skip to content

Instantly share code, notes, and snippets.

@compil3
Created November 9, 2011 21:51
Show Gist options
  • Save compil3/1353206 to your computer and use it in GitHub Desktop.
Save compil3/1353206 to your computer and use it in GitHub Desktop.
for($i=0;$i<count($prod);++$i)
{
$result=mysql_query('
INSERT INTO purchase_items (quant,pib,price,id) VALUES ({$quant[$i]},{$pib[$i]},{$ppu[$i]},NULL);');
//add each row to the database here
if (!$result) die ("Database access failed: " . mysql_error());
else {
echo "Created";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment