PHPCMS v9 get label SQL statement solution for invalid limit problem

Source: Internet
Author: User

The get tag works well and the get is almost universal after customizing the model. But Phpcms upgrade to V9, the 2008 of a lot of functions are removed, such as the get tag, in the back automatically added a limit 0, 20, so you even write the num= ' number ' is useless, written in SQL statements, such as

{pc:get sql= "select * from V9_news ORDER by ID DESC LIMIT 2,5" cache= "3600" page= "$page" dbsource= "Discuz" return= "Data"}

Will error, the printed SQL statement is:

SELECT * from V9_news ORDER by ID DESC limit 2,5 limit 0,20

This is obviously wrong. There are 2 methods, of which the second method is the most absolute, direct code:

1. For example,

{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"}

can be controlled by adding start and Num.

2. (The more absolute method)

{pc:get sql= "select Title,url from V9_news where catid=9 and status=99 order by updatetime desc limit 0,4--" return= "V"}

Note the two minus sign after 4, v9 the limit 0,20 statement to the comment!

PHPCMS v9 get label SQL statement solution for invalid limit problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.