SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    May 2012
    Posts
    1,087
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post How can i output like this structure

    Hi, I need some help please, how can i get this kind of output.

    Code:
    president
    john                 mill
    michael           kane
    
    vice-president
    
    Marish          Karpov
    Mallia           Konsipe
    
    secretary
    Josh            Freeman
    Honey         Leejirxia
    here is my table structure

    officials_tbl
    Code:
    of_id         auto_incrment
    of_name
    of_lname
    of_age
    pos_id
    position_tbl

    Code:
    pos_id         auto_incrment
    position
    voting_tbl

    Code:
    of_id
    pos_id
    vote_count

    I tried inner join but the output is somethng like this.

    Code:
    president
    john                 mill
    president
    michael           kane
    etc....
    ......
    Thank you in advance

  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)
    Loop through the query output in your scripting language (PHP?) and create the output the way you want it.


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
  •