User Profile

Collapse

Profile Sidebar

Collapse
marcucio
marcucio
Last Activity: Feb 26 '08, 02:34 AM
Joined: Feb 20 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • marcucio
    replied to Complex query question
    well right now I have:

    [PHP]$sql = "SELECT tl_topic.topic_ id, tl_topic.title, tl_topic.user_i d FROM tl_team_topic, tl_topic WHERE tl_team_topic.t eam_id = '$team_id' AND tl_team_topic.t opic_id = tl_topic.topic_ id ORDER BY tl_topic.topic_ id DESC"[/PHP]

    and this gets all the topics in the right order if none had comments. but I want to sort by topic_id and the latest comment on each topic. If there are no comments...
    See more | Go to post

    Leave a comment:


  • marcucio
    replied to Complex query question
    Let me just be clear what I am asking for, I am just looking for the mySQL SELECT statement which would give me all the topics in the correct order.

    I was trying to do it with temperary tables and joins but I think there might be an easier way

    The first topic would be the newest one added or the one with the latest comment

    Thanks Again...
    See more | Go to post

    Leave a comment:


  • marcucio
    started a topic Complex query question

    Complex query question

    For some reason I can't figure out the following. I am using mysql and php.

    I have the following 2 tables

    tl_topic //a topic
    topic_id //id of the topic
    title //the title of the topic
    comment //the body of the topic
    user_id //the user who posted the topic

    tl_topic_commen t //comments on a topic
    topic_id
    ...
    See more | Go to post
No activity results to display
Show More
Working...