Reorder MySQL rows via PHP?
Posted 29 October 2006 - 05:53 AM
I don't really want to do it by using the 'ORDER BY' SQL statement, but rather actually move the rows in the MySQL database.
Thank you for the help.
Posted 29 October 2006 - 05:59 AM
And, the only way to reprder the rows would be to create a script that would overwrite all the records in the order you want. Again, bad idea.
I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net
Posted 29 October 2006 - 08:13 AM
if so, then what you will want to do is create another field in your table called "layout_order" or other some such descriptive thing. Then you will want to in your query, order by layout_order. If you want to "bump" the item up a notch, then you would swap numbers with the it and the one above it.
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users