如何在PHPMyAdmin中为表格设置默认排序(即始终为“主键-降序") [英] How can I set a default sort for tables in PHPMyAdmin (i.e. always "Primary key - Descending")

查看:509
本文介绍了如何在PHPMyAdmin中为表格设置默认排序(即始终为“主键-降序")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管它在许多方面令人讨厌,但我在编写PHP时始终使用PHPMyAdmin调试数据库问题.默认情况下,它按主键升序对表进行排序.默认情况下,我宁愿在99%的时间中将最新数据(我的测试数据)显示在顶部,而不是将无用的前几条记录保存下来.

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.

是否可以将PHPMyAdmin配置为默认显示最新记录?要改变类似的行为?

Is there a way to configure PHPMyAdmin to show the newest records by default? To alter similar behavior?

推荐答案

对于任何其他来这里寻找答案的人:

For anyone else who comes here looking for an answer:

在phpMyAdmin 4.5.0中,也许在早期版本中,也可以设置 $ cfg ['TablePrimaryKeyOrder'] 配置如下:

In phpMyAdmin 4.5.0, maybe in earlier versions too, you can set the $cfg['TablePrimaryKeyOrder'] config like so:

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

当没有外部定义的排序顺序时,这定义了具有主键的表的默认排序顺序.可接受的值:['NONE','ASC','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.

这篇关于如何在PHPMyAdmin中为表格设置默认排序(即始终为“主键-降序")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆