Skip to content

Instantly share code, notes, and snippets.

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