I have a database that is MySQL / Php technology. I have a database that will have the following columns:
Id (primary key)
Title
Description
Del
Date
Position
And so On….
Each row represents a ticket or a record the user adds to the database. The User can determine the position of the records by selecting an integer to put into the database (1 to n). Then when all records are displayed it will display by position number. With position one displaying first. The only rule is that there cannot be a position with the same value (there cannot be more than one record with position 1). Also user should be able to select position number upon inserting new records. Also the user should be able to change the position of any existing records or rows.
What sorting Algorithm or programming code should I use to approach this problem or task?
use a field
order int(11)make an alter table to table to add this field.
when the user adds a new record makes a query to retrieve the order number and the biggest max +1 week’s new record.
then to choose the order of the records you can use something like: http://jqueryui.com/demos/sortable/