21,886
社区成员
发帖
与我相关
我的任务
分享
function exequery($C,$Q)
{
mysql_query("SET NAMES 'utf8'");
return mysql_query($Q,$C);
}
//创建临时表
exequery( $connection, $create_table_sql );
//插入报表数据 ,这里就返回false了。
exequery( $connection, $insert_table_sql);
//获取分组查询后的语句
$cursor = exequery( $connection, $select_table_sql );
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_table_report (销售员 VARCHAR(255) NULL ,数量 VARCHAR(255) NULL );INSERT INTO tmp_table_report VALUES('郭晟','100');INSERT INTO tmp_table_report VALUES('郭晟','84');INSERT INTO tmp_table_report VALUES('毛毛','77');INSERT INTO tmp_table_report VALUES('毛毛','83');INSERT INTO tmp_table_report VALUES('孙祥','79'); select SUM(数量) FROM tmp_table_report GROUP BY 销售员;