稿子统计字数

WBOY
Release: 2016-06-13 13:13:39
Original
1180 people have browsed it

文章统计字数
文章表
id author titile content
怎么统计出来每个作者拥有的文章数 并且俺文章数从多到少排列出来
就是第一个显示文章数最多(多少显示出来) 总的文章内容字数
接下来用列表显示出各个标题
第二个就是显示文章数第二的

一下类推
我自己没有很好地思路 想的太麻烦了 想借鉴个好的想法

------解决方案--------------------
你准备做什么能详细说明吗?如果只是简单的统计文章的字数我可以告诉你 world就可以统计文章的字数的。
------解决方案--------------------

SQL code
SELECT id, titile, SUM( LENGTH( titile ) ) AS length
FROM  `your_table` 
where author = '".$author."' 
order by length desc
<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
SQL code

select count(*) as count, author,sum(length(content)), group_concat(title)
group by author
order by count DESC
<br><font color="#e78608">------解决方案--------------------</font><br>一个sql语句搞不定。就用俩foreach。外面是作者,里面是文章标题列表 <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!