当有人选择一个服务号时,它会弹出并只给出一条记录。我希望它从两张桌子中得到总计..
<?php
$qry = mysql_query ("SELECT SUM(fruit) AS total FROM fruitinventory WHERE `fruitcolor` LIKE '%{$_POST['select']}%'");
$row2 = mysql_fetch_assoc($qry);
echo $row['total'];
?>
<?php
$qry = mysql_query ("SELECT SUM(fruitsmart) AS total FROM fruitrotten WHERE `fruitcolor` LIKE '%{$_POST['select']}%'");
$row = mysql_fetch_assoc($qry);
echo $row['total'];
?>
然后
我也希望同时显示两行的总数。
<?php
$total return = $row+$row2
?>