Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the ineffectiveness of limit in phpcms

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What is the solution that limit doesn't work in phpcms? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

What if phpcms limit doesn't work?

Recently, when I was doing a station with PHPCMS V9, I found that get tags are very easy to use. After customizing the model, get has become almost omnipotent. However, after upgrading PHPCMS to V9, many functions of 2008 have been removed, such as the get tag, which automatically adds a LIMIT 0LI 20, so that it is useless even if you write the num=' number', in the SQL statement, for example

{pc:get sql= "SELECT * FROM v9_news ORDER BY id DESC LIMIT 2 data 5" cache= "3600" page= "$page" dbsource= "discuz" return= "data"}

An error will be reported, and the printed SQL statement is:

SELECT * FROM v9_news ORDER BY id DESC LIMIT 2 LIMIT 5 LIMIT 0 Magi 20

This is obviously wrong. Two methods have been found on the forum, of which the second method is the best, posting the code directly:

1. such as

{pc:get sql= "SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc" start= "0" num= "4" return= "v"}

It can be controlled by adding start and num.

two。 (a more unique method)

{pc:get sql= "SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc limit 0jin4muri -" return= "v"} Thank you for your reading! After reading the above, do you have a general understanding of the solution that limit does not work in phpcms? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report