Thread: Ordering Info

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Randolph, NJ
    Posts
    36
    Rep Power
    15
    I have a script that has the following field names.

    name, email, state, mtn, and review

    I know how to add these to the database and loop through them all, but I want the looping page to show the entries in order by the "state" they choose. It will be a drop down menu with the state names like "NJ and PA" And on the looping page it puts all the rows in order by the state.

    So would I go through and use "if" statements for all 50 states? Or is there a simpler way top do this. Thank you.

    ------------------
    ================
    -Khill, www.tsrealm.com
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    23
    Rep Power
    0
    in your sql query juste state "order by 'state' "

    That's do the job for you.

    Mzzls
    Dave

Similar Threads

  1. Getting database info based on db info
    By Zamees in forum PHP Development
    Replies: 3
    Last Post: February 2nd, 2004, 08:55 PM
  2. Hiding MySQL connect info in a form
    By Scurvy in forum PHP Development
    Replies: 3
    Last Post: October 14th, 2003, 02:20 PM
  3. How can I start mySQL server
    By jyu1 in forum MySQL Help
    Replies: 2
    Last Post: September 5th, 2003, 11:06 AM
  4. How to tell if there's unread info in an istream?
    By MJEggertson in forum C Programming
    Replies: 2
    Last Post: September 2nd, 2003, 02:25 AM
  5. Ordering info returned from database
    By IMA2K in forum PHP Development
    Replies: 4
    Last Post: August 16th, 2003, 11:36 AM

IMN logo majestic logo threadwatch logo seochat tools logo