Note that there are some explanatory texts on larger screens.

plurals
  1. PORun Multiple queries and one time
    text
    copied!<p>Ok! I have a script that is part of a live auction and my code is not all working and I am at the end of my rope! The below code is the two ways I have tried with no luck:</p> <blockquote> <pre><code> &lt;? if(isset($_GET['golive'])) { $id = $_POST['id']; $totalamount = $_POST['amount']; $ordernumber = $_POST['ordernumber']; mysql_connect("localhost","DBusername","DBpassword") or die(mysql_error()); mysql_select_db("DBname") or die(mysql_error(header('Location: live_auction.php?ordermun=error'))); mysql_query("INSERT INTO auction_bundle (`purchaser_id`,`amount`,`order_number`,`date`) VALUES (".$id.",".$totalamount.",".$ordernumber.",NOW()) UPDATE auction_products SET order_number=".$ordernumber." WHERE on_now=1; UPDATE auction_products SET sold=1 WHERE on_now=1; UPDATE auction_products SET on_now=3 WHERE on_now=1"); header('Location: live_auction.php?ordermun='.$ordernumber.''); } ?&gt; </code></pre> </blockquote> <p>I Also Tried</p> <blockquote> <pre><code> &lt;? if(isset($_GET['golive'])) { $id = $_POST['id']; $totalamount = $_POST['amount']; $ordernumber = $_POST['ordernumber']; mysql_connect("localhost","DBusername","DBpassword") or die(mysql_error()); mysql_select_db("DBname") or die(mysql_error(header('Location: live_auction.php?ordermun=error'))); mysql_query("INSERT INTO auction_bundle (`purchaser_id`,`amount`,`order_number`,`date`) VALUES (".$id.",".$totalamount.",".$ordernumber.",NOW()"); mysql_query("UPDATE auction_products SET order_number=".$ordernumber." WHERE on_now=1"); mysql_query("UPDATE auction_products SET sold=1 WHERE on_now=1"); mysql_query("UPDATE auction_products SET on_now=3 WHERE on_now=1"); header('Location: live_auction.php?ordermun='.$ordernumber.''); } ?&gt; </code></pre> </blockquote> <p>This second one was able to change the auction_products table but still would not INSERT and other query. What am I missing. I need all four of those to happen at the time that the golive button is clicked.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload