How can I set a default sort for tables in PHPMyAdmin (i.e. always “Primary key - Descending”)

后端 未结 7 1027
情书的邮戳
情书的邮戳 2020-12-11 01:19

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%

7条回答
  •  情话喂你
    2020-12-11 01:32

    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:

    $cfg['TablePrimaryKeyOrder'] = 'DESC';
    

    This defines the default sort order for the tables, having a primary key, when there is no sort order defines externally. Acceptable values : [‘NONE’, ‘ASC’, ‘DESC’]

    This sets the default sort if the table has a primary key and that no other sort has been applied to it.

提交回复
热议问题