Use limit in Phpcms get

Source: Internet
Author: User

Recently in using Phpcms V9 to make a station, found that get tags very useful, custom model after get almost become omnipotent. 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" Dbsou Rce=return="Data"}           

Will error, the printed SQL statement is:

2,0,   

This is obviously wrong. 2 methods were found on the forum, the second of which was the most absolute, and the code was directly affixed:

1. For example,

{PC: Get sql="Select Title,url from V9_news where catid=9 and status=99 order by updatetime Desc" Start=< c12> "0" num=return="V"}         

can be controlled by adding start and Num.

2. (The more absolute method)

{PC: Get SQL=return="V"}     

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

Use limit in Phpcms get

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.