sort on field names; refresh page?

Reply

Join Date: Sep 2004
Posts: 2
Reputation: vree is an unknown quantity at this point 
Solved Threads: 0
vree vree is offline Offline
Newbie Poster

sort on field names; refresh page?

 
0
  #1
Sep 13th, 2004
I only started last week with php mysql(be nice)

I have a MySQL db where a user can enter contact info, usually stuff:
FirstName
LastName
Address
City
State
Zip

I return this info to a php page which shows all info in db.

$result = mysql_query("SELECT * FROM contacts");

I would like to make some sort fields for the page. Sort by LastName or Sort by State.

I know how to write the sql for the query for the db, what I am unsure of is how to use it on the php page and get the page re-displayed when the label is clicked?

hope thats clear. thank you for your time.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: sort on field names; refresh page?

 
0
  #2
Sep 14th, 2004
Sort by LastName
[PHP]$result = mysql_query("SELECT * FROM contacts ORDERBY LastName");[/PHP]

Sort by State
[PHP]$result = mysql_query("SELECT * FROM contacts ORDERBY State");[/PHP]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC