dedecms uses sql statement to obtain article link address
Introduction:
In dedecms, you can use sql statements with dede tags to make personalized calls. The following will introduce to you how to use SQL statements to call the document list and obtain the page address.
The basic reference format is:
{dede:sql sql='select 字段 From 表名称 where 条件语句'} [field:字段名/] {/dede:sql}
From the above basic format, we can basically convert a call tag that calls the document list, the code is:
{dede:sql sql='select * From dede_archives limit 10'} <a href="../plus/view.php?aid=[field:id/]">[field:title/]</a> {/dede:sql}
The underlying template address of the above document link is dynamic, so how to convert it so that it can be linked to a static address? Here we only need to convert [field:id/]. The complete code after conversion is:
{dede:sql sql="SELECT * FROM dede_archives limit 10"} <li> <a href='[field:id runphp='yes'] $id=@me;@me='';$url=GetOneArchive($id);@me=$url['arcurl'];[/field:id]' title="[field:title/]" target="_blank">[field:title function=cn_substr(@me,30,0)/]</a> </li> {/dede:sql}
Related recommendations: 梦Weavercms
The above is the detailed content of dedecms uses sql statement to obtain article link address. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

Analysis of the Impact of MySQL Connection Number on Database Performance With the continuous development of Internet applications, databases have become an important data storage and management tool to support application systems. In the database system, the number of connections is an important concept, which is directly related to the performance and stability of the database system. This article will start from the perspective of MySQL database, explore the impact of the number of connections on database performance, and analyze it through specific code examples. 1. What is the number of connections? The number of connections refers to the number of client connections supported by the database system at the same time. It can also be managed

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

Template replacement can be implemented in Dedecms through the following steps: modify the global.cfg file and set the required language pack. Modify the taglib.inc.php hook file and add support for language suffix template files. Create a new template file with a language suffix and modify the required content. Clear Dedecms cache.

Dedecms is an open source CMS that can be used to create various types of websites, including: news websites, blogs, e-commerce websites, forums and community websites, educational websites, portals, other types of websites (such as corporate websites, personal websites, photo album websites, video sharing website)

How to upload local videos using Dedecms? Prepare the video file in a format that is supported by Dedecms. Log in to the Dedecms management backend and create a new video category. Upload video files on the video management page, fill in the relevant information and select the video category. To embed a video while editing an article, enter the file name of the uploaded video and adjust its dimensions.

Basic concepts and usage of SQL in Go language SQL (StructuredQueryLanguage) is a language specially used to manage and operate relational databases. In Go language, we usually use SQL to perform database operations, such as querying data, inserting data, updating data, deleting data, etc. This article will introduce the basic concepts and usage of SQL in Go language, with specific code examples. 1. Connect to the database In Go language, we can use third-party libraries to connect data
