所以,我试图向那些为我工作的人展示他们当天做了多少......无论如何你可以告诉我为什么这只给了我一个" 0&#34 ;返回?
$sql = "
SELECT SUM(money_earned) as money_earned
FROM staff_pay
WHERE DATE(time_charged)=CURDATE()
AND staff_id={$_SESSION['staff_id']}
";
答案 0 :(得分:-1)
试试这个
$sid = $_SESSION['staff_id'];
$sql = "
SELECT SUM(money_earned) as money_earned
FROM staff_pay
WHERE DATE(time_charged)=CURDATE()
AND staff_id=$sid";