home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Sorting recordsets via a link

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1445
Discussions: 200,927, Posts: 2,379,139, Members: 246,294
Old June 8th, 2006, 01:06 PM   Digg it!   #1 (permalink)
Senior Member
 
reiss's Avatar
 
Join Date: Jan 2004
Location: London UK
Posts: 527
Sorting recordsets via a link

Hi
have created a database table which contains the following fields -

id, Product, product Image, description, type, price.

have created a recordset and a repeat region to display all the fields neatly organised into a htm table.

I would like to have table headings that give the user options to - sort by price, sort by type and the table reorganises itself, but dont know where to begin. am quite a database noob, so simple is better for me!

am using PHP & MySQL with dreamweaver 8

thanks in advance
__________________
Signature images disabled.
reiss is offline   Reply With Quote
Old June 8th, 2006, 01:14 PM     #2 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
You can do this either on the client side, or the server side.

Client side javascript a la here: http://www.mattkruse.com/javascript/sorttable/

Server side, use GET variables (SANITIZE THEM!), hit the database again and redisplay data.

Which to use really depends on how much and the types of data you are displaying.

Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
jkrohn is offline   Reply With Quote
Old June 8th, 2006, 02:32 PM     #3 (permalink)
Senior Member
 
reiss's Avatar
 
Join Date: Jan 2004
Location: London UK
Posts: 527
thanks jkrohn, will have a look a some javascript
reiss is offline   Reply With Quote
Old June 8th, 2006, 03:19 PM     #4 (permalink)
Senior Member
 
reiss's Avatar
 
Join Date: Jan 2004
Location: London UK
Posts: 527
was hoping it would be a little simpler! my coding is very novice, been relying on dreamweaver inserts
reiss is offline   Reply With Quote
Old June 8th, 2006, 03:30 PM     #5 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
If you want it to be simpler add get variables to links on the header columns or arrows next to them and hit the DB again with a different order by clause.

Jkrohn
jkrohn is offline   Reply With Quote
Old August 24th, 2006, 02:51 PM     #6 (permalink)
Member
 
Bootlegger's Avatar
 
Join Date: Aug 2003
Posts: 91
Use the ORDER BY clause in your SQL query with ASC or DESC. This is the easiest and most optimal way to go.
Bootlegger is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ bubble sorting NodX5 Webmastering and Programming 6 November 22nd, 2005 07:18 PM
mysql sorting Cyberlore Webmastering and Programming 2 December 10th, 2004 03:00 PM
Sorting MP3's deltaf508 General Tech Discussion 2 August 29th, 2002 07:51 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2867)
Is the PSU I received dead? (10)
windows vista security holes (9)
HIS HD5770 graphic card question (15)
Foreign voltage (10)
Print spooler problem (13)
Install XP pro and a Vista laptop ?.. (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
Ideal cheap graph card for PC-Gamin.. (15)
New Computer wont recognize XP disc (7)
EVGA 9800 gtx help with finding a g.. (8)
World's largest Monopoly Game using.. (331)
Modern Warfare 2: Who Bought It? (61)
Recent Discussions
Fire in DVD (2)
Regular Build (0)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
EVGA 9800 gtx help with finding a goo.. (8)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)


All times are GMT -4. The time now is 02:42 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28