在我的Php 代码中,我有查询作为
SELECT COUNT(id) AS todayleads
FROM `lead_data`
where `date` = '$todate' AND lead_status = 1
AND uid = '$userid' OR assign_to = '$userid'
当我回应查询时,结果是我
SELECT COUNT(id) AS todayleads
FROM `lead_data`
where `date` = '2018-01-12' AND lead_status = 1
AND uid = '3' OR assign_to = '3'
输出为我提供了从头到尾的所有数据。但是预期的 O/p只是具有 lead_status = 1 和 uid = 3 或 assign_to = 3 的数据。
据我了解,根据您的评论,您应该在 WHERE 子句中添加一个括号: