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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.