我正在以这种方式计算一个参数(X):
<?php
$link=mysql_connect("localhost","root","");
mysql_select_db("hand");
$result = mysql_query("select * from sessions",$link);
$num_calls = mysql_num_rows($result);
echo '<br/>'."\n Total X :\n $num_calls ".'<br/>';
?>
我正在以这种方式计算另一个参数(Y):
<?php
mysql_connect("localhost","root","");
mysql_select_db("hand");
$result = mysql_query("SELECT * FROM cars WHERE start_at > TIMESTAMPADD(WEEK, -4, CURDATE()) AND TIMESTAMPDIFF(MINUTE, start_at, end_at) > 5");
$num_rows = mysql_num_rows($result);
echo '<br/>'."\n Total Y :\n $num_rows ".'<br/>';
?>
在另一个地方,我需要计算口粮 X/Y。我该怎么做,因为它需要在同一个 html 页面的另一个字段中完成。