Hi
I have a mySQL db table with records that are, effectively, blocks of text, like paragraphs in a story (for illustration).
Via an on-line form, I need to display these in the order the user requires. No problem. I add a field called 'sequence' and the user can specify an integer representing the order in which the records display, lowest first, as they enter each new record.
Next, they view the finished result listing all the records in that sequence. They want to move a paragraph. Now, they COULD be required to simply edit each record to re-order them, but the longer this table is, the more that becomes untenable.
I can put field on the form to allow the user to specify where to move the record (e.g. above record 10, below record 15, at the start, at the end, etc). I can post that off to a page to process it.
Does anyone have a snippet of code that would alter the 'sequence' field accordingly?
Let's assume the table looked like this:
contentid int(4) NOT NULL auto_increment (Primary & Unique)
contentsequence int(2) default NULL
bodypara text default NULL
Any help much appreciated, as I have been pondering this one for weeks. There must be an easy way to do this.
Trevor