SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Tweak to this query help please

    Code MySQL:
    SELECT 
    l.image, l.title, l.price, l.listing_id, (SELECT COUNT(bid) FROM auction_bid WHERE listing_id = l.listing_id) as num, (SELECT MAX(bid) FROM auction_bid WHERE listing_id = l.listing_id) as maxbid 
    FROM auction_listing l 
    GROUP BY l.listing_id

    I need this modified so that it only returns results if the max(bid)'s member_id = $_SESSION['member_id'].

    How can I do this?

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    is that your complete query? because the GROUP BY does nothing useful.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •