Forums
This topic is locked
Letting the User order records.
Posted 28 Dec 2002 23:19:49
1
has voted
28 Dec 2002 23:19:49 David Hayes posted:
Hello,Recently I have been tryng figure out how to let a user decide which record gets displayed first. I first tried doing this with a simple table.
<pre id=code><font face=courier size=2 id=code>
( ID | Name | MyOrder )
-----------------------
| 0 | Jack | 0 |
-----------------------
| 1 | Jill | 1 |
-----------------------
</font id=code></pre id=code>
Now I allready now how to sort the records ASC and DESC based on the MyOrder column. So I set up a page that displays the entire table and sorts it ASC by the MyOrder column.
<center>----------------------------------------------------------------
<font face='Arial'>
<font size=4>Names In Database:</font id=size4>
Jack
Jill
...
</font id='Arial'>
----------------------------------------------------------------
^Webpage
</center>
What I would like to do is add two buttons to each recordallowing the User to move them up or down.
<center>-----------------------
Jack | up / down
Jill | up / down
-----------------------</center>
What I want to happens is when a user clicks on the down button next to Jack, Jack's MyOrder value becomes 1, and Jill's becomes 0. Basicaly they swap MyOrder values and in tern swap positions.
How can I do this?
Thanks In advance.
Replies
Replied 02 Jan 2003 04:21:26
02 Jan 2003 04:21:26 David Hayes replied:
bump