SELECT authorid, FLOOR((dateline+28800)/604800) AS wk, COUNT(*) AS pcnt, SUM(CHAR_LENGTH(message)) AS scnt FROM clcn_posts WHERE tid != 3706 GROUP BY wk, authorid ORDER BY authorid, wk;
复制代码
绘图程序
<?php
set_time_limit(0);
$conn = new mysqli('127.0.0.1', '*', '*', '*');
$query = $conn->query('SELECT authorid, FLOOR((dateline+28800)/604800) AS wk, COUNT(*) AS pcnt, SUM(CHAR_LENGTH(message)) AS scnt FROM clcn_posts WHERE tid != 3706 GROUP BY wk, authorid ORDER BY authorid, wk;');