Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    13

    Unanswered: List row of records horizontally

    Hi there,

    Code:
    select tag_id from tags
    Result of above query would be like below;

    tag_id
    100100
    100101
    100102
    100103
    100104

    Question is, how can i do it so that the records will be displayed horizontally ? example below;

    tag_id1 tag_id2 tag_id3
    100100 100102 100104
    100101 100103

    I want to set the limit of each row to 2 (can be any number) and the next result set would be displayed in the second column and so on.

    Can we do that in mysql ?

    Thank you in advanced.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by gompuok View Post
    Can we do that in mysql ?
    no

    do it in your application language (php or whatever)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    This is a display issue and should be tackled by your front-end application, e.g. PHP
    George
    Home | Blog

  4. #4
    Join Date
    Oct 2008
    Posts
    13
    Oh, I got it. You know i wont stop trying until an expert told me not to.

    I will do it in php then.
    Thanks friends.

Posting Permissions

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