sort html data table (up/down arrows)

01-10-10, 01:51 PM
|
|
New Member
|
|
Join Date: Jan 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
sort html data table (up/down arrows)
I have data in a mysql table and I need a system that make it possible to move up and down this data (by means of arrows button (up and down)) rows whenever they are rendered in the browser and the write back or remember this order for the next shows. The submit of the form for every sort operation is not a problem, as the mass of data is small. I just need a good and simple pattern to follow, not the detailed code.
Thank you.
|

01-10-10, 02:25 PM
|
|
Aspiring Coder
|
|
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
|
|
|
|

01-10-10, 02:44 PM
|
|
Aspiring Coder
|
|
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
|
|
|
|

01-10-10, 08:41 PM
|
 |
Level II Curmudgeon
|
|
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
|
|
I'd strongly recommend adding this code to help prevent potential naughtiness:
$sort = preg_replace("/[^0-9a-z]/i",'', $_GET['sort']);
|

01-10-10, 09:00 PM
|
 |
-
|
|
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
|
|
You might want to use session variables:
|

01-11-10, 04:21 AM
|
|
New Member
|
|
Join Date: Jan 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks...anyway your response does not seem to help me...read carefully the question
|

01-11-10, 05:44 AM
|
|
Aspiring Coder
|
|
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
|
|
I re-read your question, and it is exactly what you ask for. If you need something different, please specify.
Quote:
|
I need a system that make it possible to move up and down this data (by means of arrows button (up and down)) rows whenever they are rendered in the browser and the write back or remember this order...not the detailed code.
|
For sanitation, I would put good strings in an array, then use in_array(). The strings aren't going to change.
|

01-11-10, 05:46 AM
|
|
Aspiring Coder
|
|
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
|
|
Quote:
Originally Posted by wirehopper
You might want to use session variables:
|
I suggested writing to a file, because I thought he wanted it saved between sessions.
|

01-11-10, 06:02 AM
|
|
New Member
|
|
Join Date: Jan 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I found some solutions:
PHP ::
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|