As it was pointed out in the answers, I was not looking to organize results, but to filter them. I'm sorry for the confusion! I've tried my best to google my way out of this problem, but I'm having a very hard time finding a solution..I have a SQL database with this structure, as I'm trying to make a basic CMSageid | title | pagetext | menu_parWhat I want to do is make a navigation on the page, that loops all the rows and makes them look like links, which my teacher helped me with a few months back:\[code\]$query_MenuItems = "SELECT pageid,title,menu_par FROM v2 ORDER BY menu_par ASC";$MenuItems = $mysqli->query($query_MenuItems);$row_MenuItem = $MenuItems->fetch_assoc();$totalRows_MenuItems = $MenuItems->num_rows; do { echo "<a href=http://stackoverflow.com/questions/10551501//"?page={$row_MenuItem['pageid']}\">{$row_MenuItem['title']}</a><br/>";} while ($row_MenuItem = $MenuItems->fetch_assoc());}\[/code\]This works fine, however my issue is that I have no idea how to sort the different links, based on what their menu_par value is.I feel like I have tried everything in my power to fix this, and it is stressing me outIs there any way I can make a similiar loop as the one above, but sorting it by using more than one?:\[code\]while ($row_MenuItem = $MenuItems->fetch_assoc()){if ("{$row_MenuItem['menu_par']}" == '1') echo"<a href=http://stackoverflow.com/questions/10551501//"?page={$row_MenuItem['id']}\">{$row_MenuItem['title']}</a><br/>";}\[/code\]I hope you guys can help me