Re: contact list re-ordering (php/mySQL CMS design)
| From: | timo stamm | Date: | Sun, 08 Sep 2002 13:06:38 +0000 |
| Subject: | Re: contact list re-ordering (php/mySQL CMS design) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115659@lists.php.net to get a copy of this message | ||
Hi speedfreak,
uh, clients. Can't they just send the checks an be content? :-)
I have yet not done a user-sorted list in PHP/MySQL (I am using PHP since a week, now :-). But I think the following database setup should allow you to do it:
id content above below
1 lala start 2
2 blah 1 3
3 sdfg 2 5
5 oll 3 end
By referencing to the entry displayed above/below, you can quite easily write functions for getting the list and for moving rows.
Timo
Am Samstag den, 7. September 2002, um 18:08, schrieb speedfreak@chello.be:
Dear guru's, Hit a problem while developing a CMS with php/mySQL. Part of this is a contact list and this works ok (add/edit/delete with insert/update/delete queries). Now the client has requested a new feature: ability to change the order in which the contacts are being presented in the public part of this CMS (don't ask me why). I've added a field 'show_pos' to the contacts table and am able to change its value when I edit an existing record or add a new one. What I can't wrap my head around at the moment is how one deals with updating 'show_pos' for the OTHER records (while editing/deleting present record (WHERE id='$id')? Could anyone give me some pointers as to how this could be done in php and/or SQL (preferable). I sure hope anyone understands what I mean ... Cheers! newbie@a_loss -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php