Jump to content

Changing row order in MySQL using phpMyAdmin


jonw118

Recommended Posts

I have a unique situation where I have a php script that is very complex and I cannot do a simple order by priority. Instead it displays the data on the frontend in the exact order it is stored in the MySQL database.

 

Is there any way (I've looked high and low!) to change the order that rows appear in the MySQL database. Ideally I'd like for the table to display the table rows in asc order by the column "page_name".

 

Not sure this is possible to alter the table to achieve this. Does anyone know?

 

Thanks much for any help!

Link to comment
Share on other sites

I've looked high and low!

 

You can stop looking.

 

Databases do not store data in any particular order, it is up to you to write your select statements in such a way the the data is retrieved in the order you want.

 

I have a php script that is very complex and I cannot do a simple order by priority.

 

I fail to see why. Can you tell us why you can't?

Link to comment
Share on other sites

"Databases do not store data in any particular order, it is up to you to write your select statements in such a way the the data is retrieved in the order you want."

 

Yeah I know it's not written/stored in a particular order, and understand it's not flat, but once the data is in there the row location doesn't change. So that's all I'm trying to do is change the order it's stored (or shown in phpMyAdmin)... because the order it is stored is the order it displays on the frontend. But as I feared and as you confirmed there's nothing I can do about that I guess.

 

 

"I fail to see why. Can you tell us why you can't?"

 

It is pulling many different modules menus loading into a centralized menu, the modules are then joined with one another and the module in question displays several different levels of navigation (which needs to be sorted). But the other modules do not need to be sorted. And it is the same statement joining all of these together. I know that sounds confusing, just the way it was written, which I've struggled to dissect and implement an effective order by.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.