skyhighweb Posted May 13, 2017 Share Posted May 13, 2017 am having a duplicate result because of bids. i need to limit the result for only auctions to 1, i tried "limit 1" but they all get limited to 1 both bids n auctions, how do i limit only auctions to 1 how do i go about this, thanks. $query = "SELECT b.*, u.nick, a.id, a.team1, a.team2 FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction) WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('b.bidder') and b.auction = :auc_id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); Link to comment Share on other sites More sharing options...
Mahaveer Posted May 13, 2017 Share Posted May 13, 2017 use distinct in mysql query Link to comment Share on other sites More sharing options...
skyhighweb Posted May 13, 2017 Author Share Posted May 13, 2017 1 minute ago, Mahaveer said: use distinct in mysql query thanks for d reply, how do i implement that in d above code, thanks Link to comment Share on other sites More sharing options...
skyhighweb Posted May 13, 2017 Author Share Posted May 13, 2017 12 minutes ago, skyhighweb said: thanks for d reply, how do i implement that in d above code, thanks i added it but nothing seem to happen Link to comment Share on other sites More sharing options...
skyhighweb Posted May 13, 2017 Author Share Posted May 13, 2017 14 hours ago, skyhighweb said: i added it but nothing seem to happen solved thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now