hi
here is a snippet from a part of a function im trying to alter to check and update a users bidding credits.
but being a beginner its not working heheh not sure i have it in the right palce or that it is even correct coding ?
i have tried numerous variations and they all seem to skip over my code, hang up on an error and dont update anything heheh
any suggestions greatly recieved !!
function process_bid($db,$auction_id=0,$bidder=0,$bid_amount=0)
{
if ($auction_id)
{
if ($bidder)
{
if ($bid_amount)
{
$q1 = "select bidcredit from ".$this->auctions_users_table." WHERE bidcredit = \"$bidcredit\" ";
$r1 = mysql_query($q1) or die(mysql_error());
$bid_credit = mysql_fetch_array($r1);
$q2 = "UPDATE ".$this->auctions_bids_table." SET bidcredit = \"$bid_credit\" WHERE bidder=\"$bidder\" ";
$r2 = mysql_query($q2) or die(mysql_error());
$bid_credit1 = mysql_fetch_array($r2);
if($bid_credit1 < $bid_amount)
{
$this->error_message = $this->messages[2314];
}
elseif ($bid_credit1 > $bid_amount)
{
$bidcredit = $bid_credit1 - $bid_amount;
$qup = "UPDATE ".$this->auctions_users_table." SET bidcredit = ".$bidcredit." WHERE id = ".$bidder." ";
$rup = mysql_query($bidcredit) or die(mysql_error());
}
...............................................the script then goes into checking high bidder etc