Even though its obnoxious in a lot of ways I use PHPMyAdmin all the time to debug database issues while writing PHP. By default it sorts tables by primary key ascending. 99% of the time I would rather have the newest data (my test data) shown at the top by default rather than the useless first few records ever saved.
Is there a way to configure PHPMyAdmin to show the newest records by default? To alter similar behavior?
i think you can do this. Go to a table -> operations and set alter table order by descending. Next time when ever you browse you get the newest row first.
For anyone else who comes here looking for an answer:
In phpMyAdmin 4.5.0, maybe in earlier versions too, you can set the $cfg['TablePrimaryKeyOrder'] config like so:
This sets the default sort if the table has a primary key and that no other sort has been applied to it.
Why don't you use heidi SQL
Here's a guide on how:
Enable login from your host pc.
First of all, get your IP Address - http://www.whatismyip.com Hopefully that's a static IP, otherwise you have some less secure options (below)
You'll need access to create a user on the database. You can do this through Cpanel, or in PHP My Admin (assuming you have the right level of access). Google for instructions if you are unsure. Fail that you can attemtp to run this query:
If you don't have a static IP Address then you can consider using a wildcard, although this is less secure. Another more secure option is SSH tunneling
Download and install Heidi SQL
http://www.heidisql.com/download.php
Run the install (on windows ofcourse)
Finally, setup your connection, connect.
You'll find that heidi allows you to easily sort the listing of data, http://www.heidisql.com/screenshots.php?which=data It also remembers sorts and filters too.
I'm using phpMyAdmin version 4.2.3 (English) and I simply updated the sort order variable on line 488 in the DatabaseInterface.class.php file which resides in the Libraries directory. The line number (and possibly the file) may vary in other versions.
The variable $sort_order was equal to 'ASC' when I opened the file. Since changing it to DESC and uploading via FTP, the sort order for my table (which is uniquely keyed on date (DATETIME) is always DESC (most recently added records first).
Not sure if this is the best solution for all cases, but it suits my needs.
Hopefully this helps.
phpMyAdmin isn't performing any sorting at all by default. It's simply asking for all records in a table and MySQL is deciding the order.
There's no way to do this as phpMyAdmin would have to be informed about every primary key of every table (assuming there is one, and only one) and how to sort it.
phpMyAdmin does support bookmarking queries. You could DESC and then bookmark that. However, it certainly won't minimize the number of clicks, if that's what you're aim is.
http://www.phpmyadmin.net/documentation/
You can save a private bookmark with the name of the table you're browsing.
See https://phpmyadmin.readthedocs.org/en/latest/faq.html#bookmarks-can-i-execute-a-default-bookmark-automatically-when-entering-browse-mode-for-a-table