SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    List information according to the title

    If my table contain of the following fields: id, topic_title, all_feedback.

    How can i display all my result in this condition:

    List the topic_title then follow by all the related feedback, once finish list the next topic_title then follow by all the related feedback.

    Title1
    -some title1 feedback
    -some title1 feedback
    Title2
    -some title2 feedback
    -some title2 feedback

    Hope someone can help.
    Thanks.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    You can extract topic_title and all_feedback from the table, ordered by topic_title.
    But to display each topic_title only once, you'll need to use your scripting language (PHP?).
    Loop through the query result set, and display each title only the first time.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, any idea how to loop it in PHP?

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)


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
  •