Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use phpcms to sort descending

Shulou Source: shulou.com Published: 2022-06-02 12:14:32 10月04日 Update

This article will explain in detail how to use phpcms to sort in descending order, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

The implementation method of phpcms descending order: first find and open the "formguide_fields.class.php" file; then find the "listview" method part of the file; then add the statement "order by dataid desc" in the appropriate location of the code; and finally save it.

Phpcms form information in reverse order (by ID descending order) code modification!

Really drunk for a long time, or from the paging to find the list function, phpcms form information in reverse order (by ID descending order) code modification.

In formguide\ admin\ include\ formguide_fields.class.php, find:

Function listview ($page = 1, $pagesize = 30) {$page = max (intval ($page), 1); $offset = $pagesize* ($page-1); $limit = "LIMIT $offset, $pagesize"; / / phpfensi.com $result = $this- > db- > query ("SELECT * FROM $this- > tablename $limit")

In "SELECT * FROM $this- > tablename $limit", add "order by dataid desc" before "order by dataid desc" (note spaces) desc is descend descending meaning asc is ascend ascending order.

On how to use phpcms descending sort to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Code information reverse order content meaning file article method more knowledge article form good position function ascending order space statement quality part Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn MariaDB OPPO Reno Xiaomi