I keep receiving this error when performing a dutch auction with phpprobid. I am using PHP version 4.1 - there support says its becuase im not using PHP 4.4 or above. I find it hard to believe that there is not an easier fix to this problem without having to upgrade servers. Someone please help.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /vservers/bidcctvc/htdocs/auctiondetails.php on line 549
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /vservers/bidcctvc/htdocs/auctiondetails.php on line 551
n/a (0)
Im also gettting this when i click history of bid
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out FROM probid_bids WHERE id='3'' at line 1
INVALID QUERY: SELECT out FROM probid_bids WHERE id='3
if ($setts['cron_job']==2) { $manualCron = TRUE; include_once ("cron/cron1.php"); }
include ("themes/".$setts['default_theme']."/header.php");
if ($_SESSION['counted'][$_GET['id']]!="cntd") { $addClick = mysql_query("UPDATE probid_auctions SET clicks=clicks+1 WHERE id='".$_GET['id']."'"); $_SESSION['counted'][$_GET['id']]="cntd"; }
$auctionDetails = getSqlRow("SELECT * FROM probid_auctions WHERE id='".$_GET['id']."' AND active=1".$addPattern); $isAuction = getSqlNumber("SELECT * FROM probid_auctions WHERE id='".$_GET['id']."' AND active=1".$addPattern); if ($isAuction > 0) { $sellerDetails = getSqlRow("SELECT * FROM probid_users WHERE id='".$auctionDetails['ownerid']."'");
include_once("formchecker.php");
### add the messaging function if ($action=="submit_question") { if ($_GET['question_type']=="private") { $ownerId = $auctionDetails['ownerid']; $senderId = $_SESSION['memberid']; $auctionId = $_GET['id']; $message = $_GET['message']; include ("mails/askquestion.php"); $msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg]</strong></p>"; } else if ($_GET['question_type']=="public") { if (trim($_GET['message'])!="") { $currentTime = time(); $message = remSpecialChars(trim($_GET['message'])); ## we check if an exact message hasnt been posted yet $ismsg = getSqlRow("SELECT id FROM probid_public_msg WHERE auctionid='".$_GET['id']."' AND ownerid='".$auctionDetails['ownerid']."' AND posterid='".$_SESSION['memberid']."' AND msgtype='Q' AND content='".$message."'");
if ($action=="submit_answer") { $currentTime = time(); $message = remSpecialChars(trim($_GET['content'])); $addSellerMsg = mysql_query("UPDATE probid_public_msg SET content='".$message."', regdate='".$currentTime."' WHERE answerid='".$_GET['answerid']."' AND ownerid='".$_SESSION['memberid']."' AND posterid='".$_SESSION['memberid']."'") or die(mysql_error());
$questionUserId = getSqlField("SELECT posterid FROM probid_public_msg WHERE id='".$_GET['answerid']."'","posterid"); $auctionId = $auctionDetails['id']; include ("mails/notifybuyeranswerposted.php");
$msgSys_msg = "<p align=center><strong>$lang[askquestionokmsg4]</strong></p>"; echo "<script>document.location.href='auctiondetails.php?id=".$_GET['id']."'</script>"; } ### end of messaging function
$binAuction=FALSE; if ($auctionDetails['bidstart']==$auctionDetails['bnvalue']&&$auctionDetails['bn']=="Y") $binAuction=TRUE; ### We decide if the auction is about to start, if it didnt, then only the owner can see it. $notStarted=FALSE; if (strtotime($auctionDetails['startdate'])>time()) $notStarted=TRUE; if ($auctionDetails['ownerid']==$_SESSION['memberid']) $notStarted=FALSE; if ($notStarted==TRUE) { headerdetails($lang[auctdetserror]); echo "<p class=contentfont align=center>$lang[auctiondidntstart]</p>"; } else { ?>
?> </td> <td width="50%"><!-- Start Table for item details --> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr class="c5"> <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> <td><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="1" height="1"></td> </tr> <? if (!$binAuction) { ?> <tr valign="top" class="c3"> <td nowrap><b> <?=$lang[currbid]?> :</b></td> <td><b><? echo displayAmount($auctionDetails['maxbid'],$auctionDetails['currency']);?></b></td> </tr> <tr valign="top" class="c2"> <td nowrap><b> <?=$lang[startbid]?> :</b></td> <td><b><font class="redfont"><? echo displayAmount($auctionDetails['bidstart'],$auctionDetails['currency']);?></font></b> [ <span class="contentfont"><a href="javascript:WinOpen1()"> <?=$lang[convert];?> </a></span> ]</td> </tr> <? if ($_SESSION['membersarea']=="Active") { $currentBid = getSqlField("SELECT * FROM probid_bids WHERE auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."' ORDER BY bidamount DESC","bidamount") or die(mysql_error()); $isCurrentBid = getSqlNumber("SELECT * FROM probid_bids WHERE auctionid='".$_GET['id']."' AND bidderid='".$_SESSION['memberid']."'"); if ($isCurrentBid>0) { ?> <tr valign="top" class="c3"> <td><b> <?=$lang[yourbid]?> :</b></td> <td><font class='greenfont'><b><? echo displayAmount($currentBid,$auctionDetails['currency']);?></b></font></td> </tr> <? } } ?> <? } ?> <tr valign="top" class="c2"> <td><b> <?=$lang[quant]?> :</b></td> <td><b> <?=$auctionDetails['quantity'];?> </b></td> </tr> <? if (!$binAuction) { ?> <tr valign="top" class="c3"> <td nowrap><b> <?=$lang[num_bids]?> :</b></td> <td class="contentfont"><?=$auctionDetails['nrbids'];?> <? if ($auctionDetails['nrbids']>0) { echo "<a href=\"bidhistory.php?id=".$auctionDetails['id']."&name=".remSpecialChars($auctionDetails['itemname'])."&quantity=".$auctionDetails['quantity']."\">".$lang[viewhistory]."</a>"; } ?></td> </tr> <? } ?> <tr valign="top" class="c2"> <td><b> <?=$lang[timeleft]?> :</b></td> <td><? $daysLeft = daysleft($auctionDetails['enddate'],$setts['date_format']); $timeLeft = timeleft($auctionDetails['enddate'],$setts['date_format']); echo ($daysLeft>0) ? $timeLeft : $lang[bidclosed]; ?> </td> </tr> <tr valign="top" class="c3"> <td><b> <?=$lang[location]?> :</b></td> <td><? echo $auctionDetails['zip'].", ".$sellerDetails['city'].", ".$sellerDetails['state'];?></td> </tr> <tr valign="top" class="c2"> <td><b> <?=$lang[country]?> :</b></td> <td><?=$auctionDetails['country'];?></td> </tr> <tr valign="top" class="c3"> <td><b> <?=$lang[started]?> :</b></td> <td><? echo displaydatetime($auctionDetails['startdate'],$setts['date_format']);?></td> </tr> <tr valign="top" class="c2"> <td><b> <?=$lang[ends]?> :</b></td> <td><? echo displaydatetime($auctionDetails['enddate'],$setts['date_format']);?></td> </tr> <tr class="c2"> <td><b> <?=$lang[status]?> :</b></td> <td><? echo ($auctionDetails['closed']==0)?"<font class='greenfont'><b>".$lang[open]."</b></font>":"<font class='redfont'><b>".$lang[closed]."</b></font>";?></td> </tr> <tr class="c3"> <td colspan="2" class="contentfont"><table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr> <? ## if there is a reserve price, the BIN will exist until maxbid<resprice ## otherwise it will exist only until a bid is placed $showBN = showBuyNow($auctionDetails['rp'],$auctionDetails['rpvalue'],$auctionDetails['maxbid'],$auctionDetails['nrbids']); if ($showBN&&$auctionDetails['closed']==0) { $bnValue=displayAmount($auctionDetails['bnvalue'],$auctionDetails['currency']); echo "<td align=\"center\">"; if ($auctionDetails['ownerid']!=$_SESSION['memberid']&&$auctionDetails['closed']!=1) { echo (($auctionDetails['bn']=="Y"&&$auctionDetails['active']==1&&$layout['act_buynow']==1)?"<strong><a href=\"buynow.php?id=".$auctionDetails['id']."\"><img src=themes/".$setts['default_theme']."/img/system/buyitnow.gif border=0 alt=\"".$lang[buynow]."\"><br> ".$lang[bynow_for]." ".$bnValue."</a></strong> [ <span class=contentfont><a href=\"javascript:WinOpen2()\">$lang[convert]</a></span> ]":""); } else if ($auctionDetails['ownerid']==$_SESSION['memberid']&&$auctionDetails['closed']!=1) { echo $lang[cantusebuyout]; } else { echo "<strong>".(($auctionDetails['bn']=="Y"&&$auctionDetails['active']==1&&$layout['act_buynow']==1)?"<img src=themes/".$setts['default_theme']."/img/system/buyitnow.gif border=0 alt=\"".$lang[buynow]."\"><br> ".$lang[bynow_for]." ".$bnValue."":"")."</strong>"; } echo "</td>"; } echo "<td width=\"10\"></td>"; ?> </tr> </table></td> </tr> <tr class="c2"> <td colspan="2"><font class='bluefont'> <? if ($auctionDetails['rp']=="Y") { if ($auctionDetails['rpwinner']==0) echo ($auctionDetails['rpvalue']>$auctionDetails['maxbid']) ? $lang[reservenotmet] : $lang[reservemet]; echo ($auctionDetails['closed']==1&&$auctionDetails['rpvalue']>$auctionDetails['maxbid']&&$_SESSION['memberid']==$auctionDetails['ownerid']&&$auctionDetails['nrbids']>0&&$auctionDetails['rpwinner']==0) ? " <span class=\"contentfont\">[ <a href=\"reserveoffers.php?id=".$auctionDetails['id']."\"><strong>$lang[makeresoffer]</strong></a> ]</span>" : ""; } ?> </font> </td> </tr> <tr class="c3"> <td colspan="2" class="contentfont"><? if ($setts['swap_items']==1&&$auctionDetails['ownerid']!=$_SESSION['memberid']&&$auctionDetails['closed']!=1&&$auctionDetails['isswap']=="Y"&&$auctionDetails['deleted']!=1) { echo "<a href=\"swapitems.php?id=".$auctionDetails['id']."\">".$lang[offerswap]."</a>"; } ?> </td> </tr> <? if (!$binAuction||$auctionDetails['closed']==1) { ?> <tr class="c2"> <td><b> <? echo ($auctionDetails['closed']==1) ? $lang[winnerss] : $lang[highbid]; ?> :</b></td> <td class="contentfont"><b> <? if ($auctionDetails['closed'] == 1) { $getAuctionWinner = mysql_query("SELECT buyerid, bnpurchase, amount FROM probid_winners WHERE auctionid='".$auctionDetails['id']."'") or die(mysql_error()); $nbWinners = mysql_num_rows($getAuctionWinner); while ($auctionWinner = mysql_fetch_array($getAuctionWinner)) { $bidderName = getSqlField("SELECT username FROM probid_users WHERE id='".$auctionWinner['buyerid']."'","username"); echo "<font class='greenfont'>".displayAmount($auctionWinner['amount'],$auctionDetails['currency'])."</font> - ".$bidderName." <a href=\"viewfeedback.php?owner=".$auctionWinner['buyerid']."&auction=".$auctionDetails['id']."\">".getFeedback($auctionWinner['buyerid'])."</a>"; if ($auctionWinner['bnpurchase']==1) echo "</b> [ ".$lang[purchasedwithbn]." ] <b>"; if ($nbWinners>0) echo "<br>"; $foundWinner = TRUE; } if (!$foundWinner) echo $lang[na]; } else { echo ($auctionDetails['rpvalue']<=$auctionDetails['maxbid'])?"<font class='greenfont'><b>":""; echo displayAmount($auctionDetails['maxbid'],$auctionDetails['currency']); echo ($auctionDetails['rpvalue']<=$auctionDetails['maxbid'])?"</b></font><br>":"";
if ($auctionDetails['maxbid']>0) { echo " - "; if ($auctionDetails['private']!="Y") { $getBidderId=mysql_query("SELECT * FROM probid_bids WHERE auctionid='".$auctionDetails['id']."' AND out=0 AND invalid=0 ORDER BY id DESC"); $nbBidders = mysql_num_rows($getBidderId); ## display only one high bidder, and a (more...) link to a popup if there are more high bidders $highBidder=mysql_fetch_array($getBidderId);
$bidderName = getSqlField("SELECT username FROM probid_users WHERE id='".$highBidder['bidderid']."'","username"); echo $bidderName." <a href=\"viewfeedback.php?owner=".$highBidder['bidderid']."&auction=".$auctionDetails['id']."\">".getFeedback($highBidder['bidderid'])."</a>";
Both errrors come from the field name out
try to change it to be, for example, exout then your .sql file line containing out will be like this
`exout` tinyint(4) NOT NULL default '0',
Then the auctiondetail.php line 549 will become
$getBidderId=mysql_query("SELECT * FROM probid_bids WHERE auctionid='".$auctionDetails['id']."' AND exout=0 AND invalid=0 ORDER BY id DESC");
And the bidhistory.php wil become
Line 55,56
$getBidHistory = mysql_query("SELECT h.* FROM probid_bids_history h, probid_bids b WHERE
h.auctionid='".$_GET['id']."' AND h.bidid=b.id ORDER BY b.exout ASC, h.id DESC");
Line 64
$isOut = getSqlField("SELECT exout FROM probid_bids WHERE id='".$bidHistory['bidid']."'","exout");
Line 73
echo (getSqlField("SELECT rpwinner FROM probid_bids WHERE id='".$bidHistory['bidid']."'","rpwinner")>0&&getSqlField("SELECT exout FROM probid_bids WHERE id='".$bidHistory['bidid']."'","exout")!=1) ? "[ <span class=greenfont>$lang[fixedpricewinner]</span> ]" : "";