Zhimeng cms statistics column article count SQL statements and implementation methods

Source: Internet
Author: User
Tags comments

First look at the effect is as follows

Here's an easy way to do this, if you want to count how many files or software you have in each column.

The code is as follows Copy Code

{dede:channel type= ' son ' currentstyle= ' <li class= ' current ' ><a href= ' ~typelink~ ' >~typename~ (~count~) </a> </li> "}

It seems to be more advanced, oh,

Here are a few of the implementation data statistics that you might use to use the SQL tags in dedecms.

Total Comments: How many

The code is as follows Copy Code
{dede:sql sql= ' select count (ID) as C from Dede_feedback '} shared comments: [FIELD:C/] Bar {/dede:sql}

Total members: How many names

The code is as follows Copy Code
{dede:sql sql= ' select count (ID) as C from Dede_member '} Total members: [FIELD:C/] name {/dede:sql}

Total Software: How many

The code is as follows Copy Code
{dede:sql sql= ' select count (ID) as C from dede_archives where channel=3″} common software: [Field:c/] {/dede:sql}

Count the total number of documents in a column

The code is as follows Copy Code
{dede:sql sql= ' select count (ID) as C from Dede_archives where typid=1″} a total of articles: [FIELD:C//] article {/dede:sql}

I'm not saying much more. You can customize to modify the SQL can be achieved by different columns of different data table content.

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.