SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: More Joining

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Kentucky
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More Joining

    I have a Join query that works really well right now, but I need to expand on it and get 1 more join into it. Here is what I currently have:

    PHP Code:
    $publiclogs mysql_query("SELECT t2.username, t2.tanksize, t2.userid, t2.sizemeasure, t2.tanktype, t2.updated FROM homepage AS t1 INNER JOIN tank AS t2 ON t1.userid = t2.userid WHERE t1.pubpriv = 'public' ORDER BY username ASC"); 
    Here is the structure of the other table that I want to pull info from:
    Table - thread
    threadid
    title
    threadtext
    pluserid
    userid
    username
    useremail
    lastposter
    lastposttime
    replies
    views
    timestamp

    In the join query above I need to match that userid with the pluserid in the thread table and from that pull in the threadid, title, lstposter, and lastposttime just for the most recent lastposttime.

    Any help would be appreciated!


  2. #2
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe try this in the SQL forum?


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
  •