Forum Moderators: coopster
I ran across a need for him to be able to re-order items in the database through a form of some sort. A lot like the Que feature on Netflix if there are any users out there who subscribe.
I am getting wrapped around the axel on this. I know it is simple, but I am having a brain fart as to how best to make it work.
Thanks
to re-order items in the database through a form of some sort
I assume you just mean the output on the screen not the actual order of things in the db, since the order in the db doesn't reall mean anything.
Sorting Rows [mysql.com] (assuming mysql)
In other words he needs to be able to change:
Item A
Item B
Item C
Item D
To:
Item A
Item D
Item C
Item B
or any varitation thereof, so it is not just order by, but checking the existing order (which I have in a database field called 'order') and updating those that need to change while leaving those that dont alone.
I got into this last night and when I started writing my 3rd level while loop I thought there had to be an easier way.
TM
By the way, Welcome to WebmasterWorld!
You will also need to have the user click a submit button. When they do this, use another js function to select all items in the list and post them to your PHP script which will update the database accordingly.