jaxdevil Posted December 17, 2007 Share Posted December 17, 2007 Here is the full code I am using below. What I do not get is when it runs, it does not update the entry in the database. I added an echo string to display the query and it is entering properly. I don't get it. Anyone have any idea whats wrong in this one? <?php require($_SERVER['DOCUMENT_ROOT'] . "/config.inc.api.php"); ?> <?php foreach($_POST as $key => $item) { $key = $_POST[$key]; } ?> <?php $str1 = $biddernum; $str2 = $lots; $str3 = $newstatus; $str4 = $vdate; $q = "UPDATE checkout SET paid=$str3 auctiondate=$str4 WHERE bidnum=$str1 AND lotnum IN($str2)"; $r = mysql_query($q); echo $q; mysql_close(); ?> Thanks in advance guys, SK Quote Link to comment Share on other sites More sharing options...
paul2463 Posted December 17, 2007 Share Posted December 17, 2007 try this <?php require($_SERVER['DOCUMENT_ROOT'] . "/config.inc.api.php"); ?> <?php foreach($_POST as $key => $item) { $key = $_POST[$key]; } ?> <?php $str1 = $biddernum; $str2 = $lots; $str3 = $newstatus; $str4 = $vdate; $q = "UPDATE checkout SET paid='$str3' auctiondate='$str4' WHERE bidnum='$str1' AND lotnum IN('$str2')"; //note the '' around variables $r = mysql_query($q) or die ("error in query" . mysql_error()); //use this and it will tell you whats wrong echo $q; mysql_close(); ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted December 17, 2007 Share Posted December 17, 2007 In other words, put single quotes around your variables in the query. Quote Link to comment Share on other sites More sharing options...
jaxdevil Posted December 18, 2007 Author Share Posted December 18, 2007 Thank man! Once again you guys save the day! SK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.