Jump to content

[SOLVED] Query is being sent correctly, but nothing changes?


jaxdevil

Recommended Posts

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

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();
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.