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 of not outputting results in phpcms get sql

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

Share

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

This article mainly introduces the solution that phpcms get sql does not output results, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

What if phpcms get sql does not output the results?

The solution to the problem of invalid limit of PHPcms v9 get label sql statement

The get tag is so easy to use that get becomes almost omnipotent after customizing the model. 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. There are two methods, of which the second method is the best, directly affixing the code:

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 0je 4muri -" return= "v"}

Note that the two minus signs after 4 annotate the LIMIT 0Magol 20 statement that comes with v9!

Thank you for reading this article carefully. I hope it will be helpful for everyone to share the solution of not outputting the result of phpcms get sql. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

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