大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
?php
创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都网站建设、做网站、成安网络推广、小程序定制开发、成安网络营销、成安企业策划、成安品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供成安建站搭建服务,24小时服务热线:18982081108,官方网址:www.cdcxhl.com
mysql_connect('localhost','数据库帐号','数据库密码');
mysql_select_db('数据库名');
$result = mysql_query('show tables'); //获取所有表名
$all_record = 0;
while($record = mysql_fetch_row($result)) {
$tb_name = $record[0]; //表名
$n = mysql_result(mysql_query('select count(*) from `'.$tb_name.'`'),0);
$all_record+=$n;
}
echo $all_record; //总记录数
?
select a.time,sum(regTime) regSum,sum(logTime) logSum from
(select regTime time,1 regTime , 0 logSum from user union all select logTime time,0 regTime , 1 logSum from login) a group by a.time order by a.time;
------------------
select a.time,ifnull(b.regSum,0) regSum,ifnull(c.loginSum,0) loginSum from
(select regtime time from user union select logintime time from lgoin) a
left join (select regTime time,count(*) regSum from user group by regTime) b
on (a.time=b.time)
left join (select loginTime time,count(*) logSum from login group by loginTime) c
on (a.time=c.time)
order by a.time;
select DATE_FORMAT(来电时间,'%Y-%m') as 月, 问题类别 , count(1) as 数量 from
( select 来电时间, 问题类别 from mytable where 问题类别 = '农村用水投诉' ) tmptable
group by DATE_FORMAT(来电时间,'%Y-%m') ,问题类别 ORDER BY 月 ASC;