Jump to content

How to arrange a mySQL database with PHP?


PugJr

Recommended Posts

Like for instance I have 3 rows like this:

 

ID var

3  6

4  8

5  3

 

How would I select the third row and put it as the first one, then making the first row become second, and second become third or some mysql order through PHP that can just move a row from one place to another.

 

Thanks.

How would I select the third row and put it as the first one, then making the first row become second, and second become third or some mysql order through PHP that can just move a row from one place to another.

 

Are you referring to actually ALTERing the MySQL table?  Which is a bad idea, and most likely due to poor design.  Or display it in the order you described, which I like to call, reverse, or DESCending.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.