How can I set a default sort for tables in PHPMyAdmin (i.e. always quot;Primary key - Descendingquot;)(如何在 PHPMyAdmin 中为表设置默认排序(即始终为“主键 - 降序))
问题描述
尽管它在很多方面令人讨厌,但我在编写 PHP 时一直使用 PHPMyAdmin 来调试数据库问题.默认情况下,它按主键升序对表进行排序.99% 的情况下,我宁愿将最新数据(我的测试数据)默认显示在顶部,而不是保存无用的前几条记录.
有没有办法将 PHPMyAdmin 配置为默认显示最新记录?改变类似的行为?
对于来到这里寻找答案的其他人:
在 phpMyAdmin 4.5.0 中,也许在更早的版本中,您可以设置 $cfg['TablePrimaryKeyOrder'] 配置如下:
$cfg['TablePrimaryKeyOrder'] = 'DESC';<块引用>
这定义了表的默认排序顺序,有一个主键,当没有外部定义的排序顺序时.可接受的值:[‘NONE’、‘ASC’、‘DESC’]
如果表有一个主键并且没有对其应用其他排序,这将设置默认排序.
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?
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.
这篇关于如何在 PHPMyAdmin 中为表设置默认排序(即始终为“主键 - 降序")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 PHPMyAdmin 中为表设置默认排序(即始终为“主键 - 降序")
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
