search
HomeCMS TutorialEmpire CMSHow does ecms obtain the required records by executing sql?

How does ecms obtain the required records by executing sql?

How does ecms obtain the required records by executing sql?

The usage of ecms smart tag e:loop is to obtain the required records by executing sql

Under certain conditions, we require that it be displayed on a certain page of the website Specified information,

It is recommended to study "Empire cms Tutorial"

But if this kind of specification is hard-coded, the future changes will be huge. Trouble;

At this time, the advantages of sql statements are highlighted. Using sql statements, you only need to change the numbers to completely replace the displayed content;

The code is as follows:

[e:loop={'select * from phome_ecms_news where id in (2452,2697,2299,2267)',4,24,0}] 
<li><a href="<?=$bqsr[&#39;titleurl&#39;]?>"> 
<?=esub($bqr[title],28)?> 
</a><span></span></li> 
[/e:loop]

According to the specification of the sql statement, return the content information with ID numbers 2452, 2697, 2299, 2267 respectively. At the same time, the penultimate parameter behind the code is 24.

This is the execution of sql.

(The following content comes from the Internet to explain the usage of smart tags)

Instructions for using smart tags:

Smart tags (e:loop)

Format:

[e:loop={栏目ID/专题ID,显示条数,操作类型, 只显示有标题图片,附加SQL条件,显示排序}] 
模板代码内容 
[/e:loop]

Example:

The code is as follows:

[e:loop={栏目ID/专题ID,显示条数,操作类型,只显示有标题图片,附加SQL条件,显示排序}] 
<tr> 
<td> 
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a> (<?=date(&#39;Y-m-d&#39;,$bqr[newstime])?>) 
</td> 
</tr> 
[/e:loop]

The specific operation type description is as follows:

Operation type description

0 Each column Latest

1 Popular in each column

2 Recommended in each column

9 Comment ranking in each column

12 Headline information in each column

15 Download ranking of each column

25 Rating ranking of each column

26 Voting ranking of each column

3 All information latest (default table)

4 All information popular (default table)

5 All information recommendations (default table)

10 All information comment rankings (default table)

13 All information headlines (default table)

16 All information download rankings (default table)

27 All information rating rankings (default table)

28 All information voting rankings (default table)

6 Special topics Latest information

7 Topic hot information

8 Topic recommendation information

11 Topic comment ranking

14 Topic headlines

17 Each topic Download Ranking

29 Rating Ranking of Each Topic

30 Voting Ranking of Each Topic

18 Latest Each Table (Column ID='Table Name')

19 Popularity of each table (column ID='table name')

20 Recommendation of each table (column ID='table name')

21 Comment ranking of each table (column ID='table name' )

22 Headline information of each table (column ID='table name')

23 Download ranking of each table (column ID='table name')

31 Each table Rating ranking (column ID='table name')

32 Voting ranking of each table (column ID='table name')

24 Query by sql (column ID='sql statement')

Data table prefix is ​​available: "[!db.pre!]" means

The above is the detailed content of How does ecms obtain the required records by executing sql?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.