So, after creating the field, the code and what else was needed to retrieve news order as mentioned here: Planning news ordering system
I have encountered another dilemma:
- Having row
X
with order value17
and rowY
with order value19
, which is the best way to interchange their values for mysql with php code?
UPDATE
My meaning of interchange is: change a value with another.
What I am trying to achieve is similar as joomla does the sorting for its data. http://awesomescreenshot.com/01658u06e
sn_news
table:
.... id order title
==== ===== =======
1231 1 ASDAASD
1331 2 ASDXXSD
1221 3 ASDBBSD
1731 4 ASDYYSD
1531 5 ASDCCSD
I want to swap id 1221
's order 3
with the order 5
from id 1531
so it would become:
.... id order title
==== ===== =======
1231 1 ASDAASD
1331 2 ASDXXSD
--> 1221 5 ASDBBSD
1731 4 ASDYYSD
--> 1531 3 ASDCCSD