时间:2021-07-01 10:21:17 帮助过:4人阅读
第二张图重新上传下。 以11.1号数据为准就可以
图片看不到,每日汇总的话可以用linux的定时任务和php命令行传递参数,总和不是select sum(字段)就行了么?
图片看不到,每日汇总的话可以用linux的定时任务和php命令行传递参数,总和不是select sum(字段)就行了么?
你好 能不能加您qq 请教你几个问题
$result=mysql_query("SELECT 日期,网费收入,会员收入,商品收入,点卡收入,网费收入+会员收入+商品收入+点卡收入 AS 合计 FROM ".$data." ",$link);
在sql中能把 每行前列的数读取出来,第五列算个求合,在mysql查询器能查出来,但是网页上却直接没有数据。如果去掉求这四列的值,就能出来 。。。 真郁闷了
你网页上取数据的时候取了合计字段了吗?还是只有前面5个字段?
店面营业查询结果 $top=$_POST["d_s"];$end=$_POST["d_e"];$data=$_POST["shujuku"];echo "$data.$end.$top";echo "您所查询的数据是:";echo " $top";echo "到 ";echo "$end ";echo "之间的全部数据    ";echo "\r返回上页 "; echo ""; $link=mysql_connect("192.168.3.221","root","myoa888");$今天 =date("Y-m-d");mysql_query("use klserver"); //mysql_select_db("ttserver");$result=mysql_query("SELECT 日期,网费收入,会员收入,商品收入,点卡收入,网费收入+会员收入+商品收入+点卡收入 AS 合计 FROM ".$data." ",$link);echo "\n";echo"
\n";mysql_free_result($result);mysql_close($link);?>\n";while($field=mysql_fetch_field($result)){ echo" \n"; mysql_free_result($result);$result=mysql_query("SELECT $sumstr FROM $data where 日期 between '$top' and '$end'" ,$link); while($row = mysql_fetch_row($result)) { echo "".$field->name." \n"; $str= $str.$field->name.","; } //生成新的查询字段 $length=strlen($str); $sumstr=substr($str, 0, $length-1); echo $sumstr; echo "\n"; for($i=0;$i \n";}echo "".$row[$i].""; } echo "
你网页上取数据的时候取了合计字段了吗?还是只有前面5个字段?
我把代码贴出来了。我放到查询器的时候 能查出。
我在代码里,如果不做四列的求和。也能出中间四列分别的数,并且打印在网页表格里。问题是我一加上这四个数,就一个数据都没有了。所以我贴上代码了
你前四列??都已?查出各列的和了,在WEB?面上?示的?候,?什?不直接把?四列的值相加然後?示
都是中文字段,,,,?
while($field=mysql_fetch_field($result)){ echo"".$field->name." \n"; $str= $str.$field->name.","; }//用mysql_fetch_row()试试 打印$field看看有没有数据
都是中文字段,,,,?
while($field=mysql_fetch_field($result)){ echo"".$field->name." \n"; $str= $str.$field->name.","; }//用mysql_fetch_row()试试 打印$field看看有没有数据
你这个看的头疼...
给个思路给你...先查数据变数组
再依据你的表格遍历数组做运算...
select("bp_testloglist", "testEndtime", "order by testEndtime desc limit 0,1");if ($row = $db->fetch_array($query)) { $lastUpdateint = $row['0'] + 54000;}unset($query);unset($row);$lastUpdatedayint = strtotime(date("Y-m-d",$lastUpdateint)); //依据dell时间换成当天的开始时间int//依据测试记录最后时间变成abc时间$queryDateint = $lastUpdatedayint - 6* 24 * 60 * 60-54000;//获取最后2天的测试时间$queryDateint2 = $lastUpdatedayint - 24 * 60 * 60- 54000;$querDateabc2int = $queryDateint2+54000;//获得测试工站的Performance$query = $db->select("bp_testloglist", "testStation,testResult, testEndtime", "where testEndtime>=$queryDateint and testDatabase=0");while ($row = $db->fetch_array($query)) { $stationSummary[dellToabcdayint($row['2'])][$row['0']][$row['1']] = $stationSummary[dellToabcdayint($row['2'])][$row['0']][$row['1']] + 1;}unset($query);unset($row);$m_Testhate = $m_Testhate + 24 * 60 * 60;//获取测试工站名称$query = $db->query("select a.testerFullname,a.testerID,a.testerType,b.stationNamelite,a.testerName,INET_NTOA(a.testerIP) from bp_tester as a left join bp_teststation as b on a.testerType = b. stationID where a.testerShow=1 order by a.testerType, testerFullname asc");while ($row = $db->fetch_array($query)) { $testType[$row['2']] = $row['3']; $testerHost[$row['1']] = array('testerHost' => $row[4], 'testerIP' => $row['5'], 'testerStation' => $row['3']); $testerName[$row['1']] = $row['0']; $i++;}unset($query);unset($row);$currentTime = date("Y-m-d H:i:s");include_once './include/system.top.php';include_once './include/system.menu.php';?>
Tester / Date | " . date("Y-m-d", $a) . "|||||||||
---|---|---|---|---|---|---|---|---|---|
T | P | F | A | ||||||
HOST NAME: " . $value1['testerHost']; ?>" > | 0 ? @$totalPass[$value] : @$totalPass[$value] = 0; @$totalFail[$value] > 0 ? @$totalFail[$value] : @$totalFail[$value] = 0; @$totalAbort[$value] > 0 ? @$totalAbort[$value] : @$totalAbort[$value] = 0; @$totalTotal[$value] > 0 ? @$totalTotal[$value] : @$totalTotal[$value] = 0; if (arrayValue($stationSummary, $value)) { if (arrayValue($stationSummary[$value], $testerID)) { $tPass = (int) arrayValue($stationSummary[$value][$testerID], '3'); $tFail = (int) arrayValue($stationSummary[$value][$testerID], '1'); $tAbort = (int) arrayValue($stationSummary[$value][$testerID], '2'); $tTotal = $tPass + $tFail + $tAbort; $totalPass[$value] = $totalPass[$value] + $tPass; $totalFail[$value] = $totalFail[$value] + $tFail; $totalAbort[$value] = $totalAbort[$value] + $tAbort; $totalTotal[$value] = $totalTotal[$value] + $tTotal; } else { $tPass = 0; $tFail = 0; $tAbort = 0; $tTotal = $tPass + $tFail + $tAbort; $totalPass[$value] = $totalPass[$value] + $tPass; $totalFail[$value] = $totalFail[$value] + $tFail; $totalAbort[$value] = $totalAbort[$value] + $tAbort; $totalTotal[$value] = $totalTotal[$value] + $tTotal; } } else { $tPass = 0; $tFail = 0; $tAbort = 0; $tTotal = $tPass + $tFail + $tAbort; $totalPass[$value] = $totalPass[$value] + $tPass; $totalFail[$value] = $totalFail[$value] + $tFail; $totalAbort[$value] = $totalAbort[$value] + $tAbort; $totalTotal[$value] = $totalTotal[$value] + $tTotal; } if ($tTotal <> 0) { echo " | $tTotal | "; } else { echo ""; } if ($tPass <> 0) { echo " | $tPass | "; } else { echo ""; } if ($tFail <> 0) { echo " | $tFail | "; } else { echo ""; } if ($tAbort <> 0) { echo " | $tAbort | "; } else { echo ""; } } ?> |
Total | 0) { echo "$totalTotal[$value] | "; } else { echo ""; } if ($totalPass[$value] <> 0) { echo " | $totalPass[$value] | "; } else { echo ""; } if ($totalFail[$value] <> 0) { echo " | $totalFail[$value]"; } else { echo " | "; } if ($totalAbort[$value] <> 0) { echo " | $totalAbort[$value] | "; } else { echo ""; } } $totalTotal = NULL; $totalPass = NULL; $totalFail = NULL; $totalAbort = NULL; ?> |