PHP compound query statement?
怪我咯
怪我咯 2017-05-16 13:14:40
0
1
833

SELECT COUNT(*) AS num FROM lzh_cds c LEFT JOIN lzh_rds r ON c.rd_id=r.rd_id LEFT JOIN lzh_borrowers b ON c.borrowers_id=b.id
WHERE c.isdeleted = 1 AND c.cd_id LIKE '%李思%' OR c.cd_no LIKE '%李思%' OR b.name LIKE '%李思%' OR r.rd_no LIKE '%李思%' AND c.status=6;
Why does this compound query statement c.isdeleted = 1 c.status=6 not work? The queried data only has fuzzy results

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
伊谢尔伦

When "AND" or "OR" of the condition appear simultaneously in a where statement, you should enclose multiple ORs in parentheses and then perform "AND" with AND, or enclose multiple ANDs in parentheses and then perform "AND" with OR. Make “or”

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template