search
HomeCMS TutorialDEDECMSHow does DreamWeaver SQL call the article and obtain the static address?

How does DreamWeaver SQL call the article and obtain the static address?

How does Dreamweaver SQL call the article and obtain the static address?

How to call the DreamWeaver SQL article and obtain the static address

Recommended learning: DreamWeaver cms

As we all know, in the Dede system In the method of SQL calling the article and obtaining the static address, I can freely use the SQL statement of the method of SQL calling the article and obtaining the static address to cooperate with the method of SQL calling the article and obtaining the static address of the Dreamweaver tag to make more personalized calls. 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 SQL method to call the article and obtain the static address is:

{dede:sql sql='select  * From dede_archives  limit 10'}
<a href="/plus/view.php?aid=[field:id/]">[field:title/]</a>
{/dede:sql}

You have seen that the underlying template address of the document link above is dynamic, so how do we convert it?

Let it be linked to a static address. Here we only need to [field:id /]Convert it, the complete code after conversion is:

{dede:sql sql="SELECT * FROM dede_archives limit 10"} 
<li>·<a href=&#39;
[field:id runphp=&#39;yes&#39;] $id=@me;@me=&#39;&#39;;$url=GetOneArchive($id);@me=$url[&#39;arcurl&#39;];[/field:id]&#39; >[field:title/]</a>
</li>
{/dede:sql}

If it is a dede:php tag, it is almost the same, mainly using the GetOneArchive method, for example:

{dede:php}
$dsql->SetQuery("SELECT * FROM dede_archives limit 10");
$dsql->Execute();
while($arr = $dsql->getArray()){
$arcurl = GetOneArchive($arr[&#39;aid&#39;]);
echo &#39;<li>·<a href=“&#39;.$arcurl[&#39;arcurl&#39;].&#39;”>[field:title/]</a></li>&#39;;
}
{/dede:php}

The above is the detailed content of How does DreamWeaver SQL call the article and obtain the static address?. 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 Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use