Thanks for the response. That is one of the problems, I am able to get members that were the highest bidders but did not meet the reserve price, but I am having trouble getting members that were out-bidded as it keeps giving 0 results:
Member was highest bidder but did not meet reserve price:
Code:
$sql = "SELECT * FROM items WHERE id IN (SELECT bids.itemid FROM bids INNER JOIN (SELECT itemid, MAX(bid) AS `bid` FROM bids WHERE bidder = '$member' GROUP BY itemid) topbids ON bids.itemid = topbids.itemid AND bids.bid = topbids.bid WHERE bidder = '$member' AND items.reserveprice > items.currentprice) ORDER BY endtime";
Member was out-bidded:
Code:
$sql = "SELECT * FROM items WHERE id IN (SELECT bids.itemid FROM bids INNER JOIN (SELECT itemid, MAX(bid) AS `bid` FROM bids WHERE bidder = '$member' GROUP BY itemid) topbids ON bids.itemid = topbids.itemid AND bids.bid = topbids.bid WHERE bidder != '$member') ORDER BY endtime";
The code that finds the members that were outbidded should be working as far as I know. Let me know if you can spot something wrong there.
Thanks
Bookmarks