Re: Re-ordering items

From: Date: Fri, 04 Apr 2003 06:46:34 +0000
Subject: Re: Re-ordering items
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-26829@lists.php.net to get a copy of this message
On Friday 04 April 2003 00:53, Charles Kline wrote: > I have a table that contains the 'Sort Order' of some stories which are > kept in another table. I want to be able to 're-order' these items but > I am not sure how to go about this (technique wise). > > For example: I have a form with a series of select menus. Each menu > represents the position of the story on the page where they are > displayed. Each menu has the same list of titles, and I want to use > these menus to re-order the display order. So the menus display the > titles in the current order, and changing one of the menus - reorders > the position in the sort order table. > > Anyone have any thoughts? First you going to need some extra fields in your table to hold the sort information. There are at least two ways to go about this: - Have one extra field which holds the absolute position of the record - Have two extra fields to create a linked list. The fields will hold the previous and next records in the list I'll leave you to work out the implementation details. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db ------------------------------------------ /* The "cutting edge" is getting rather dull. -- Andy Purshottam */

« previous php.db (#26829) next »