Re: [PHP] Resequencing logic

2004-05-12 Thread Burhan Khalid
Matt Grimm wrote:

I apologize if this message is a repeat; I've had trouble posting with 
Thunderbird.

I'm interested in how you folks would approach the following issue:

You have a list of data, in a user-defined sequence.  For instance, a list 
of song titles that can be rearranged on a web page in any order. I don't 
think I have the best grasp of the logic involved, and as such, the problem 
is a real pain for me.  I use this approach:
I think you are after http://www.brainjar.com/dhtml/tablesort/demo.html

Cheers,
Burhan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Resequencing logic

2004-05-07 Thread Matt Grimm
I apologize if this message is a repeat; I've had trouble posting with 
Thunderbird.

I'm interested in how you folks would approach the following issue:

You have a list of data, in a user-defined sequence.  For instance, a list 
of song titles that can be rearranged on a web page in any order. I don't 
think I have the best grasp of the logic involved, and as such, the problem 
is a real pain for me.  I use this approach:

-If adding, records after or equal to the new (requested) spot are 
incremented
-If moving up, records before the current spot and after or equal to the 
new spot are incremented
-If moving down, records after the current spot and before or equal to the 
new spot are decremented
-If deleting, records after or equal to the current spot are decremented

Is there some MySQL or PHP function that will handle this sort of 
reordering business, or is there possibly a simpler logic I could use?

Thanks,
Matt
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php