Home  >  Article  >  CMS Tutorial  >  What is the SQL statement used to obtain the current article ID on the DreamWeaver document page?

What is the SQL statement used to obtain the current article ID on the DreamWeaver document page?

藏色散人
藏色散人Original
2019-11-16 11:17:162751browse

What is the SQL statement used to obtain the current article ID on the DreamWeaver document page?

What is the SQL statement used to obtain the current article ID on the Dreamweaver document page?

Dreamweaver DEDECMS document page gets the sql statement of the current article ID

The following is the code to implement dedecms to get the current article ID and display the thumbnail, if you are interested Friends can study and study:

Recommended study: dedecms tutorial

{dede:sql sql=&#39;Select * from dede_archives where id=~id~&#39;}  <!--从dede_archives表中查询当前文章ID所对应的相关信息-->   
<img src="[field:litpic/]" alt="[field:title/]" style="max-height:150px; max-width:170px;" />    
{/dede:sql}

The above content is reproduced, expand to obtain the main table and additional table field information where the current document is located:

{dede:sql sql=&#39;Select down,title from dede_addonarticle JOIN 
dede_archives ON dede_addonarticle.aid = dede_archives.id where id = ~id~&#39;} 
       <a href=&#39;[field:down/]&#39; target=&#39;_blank&#39;>[field:title/]</a> 
        {/dede:sql}

In the above example, down is a new field. When using it, make changes according to the situation.

The above is the detailed content of What is the SQL statement used to obtain the current article ID on the DreamWeaver document page?. 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