我的PHP代码出现了一个奇怪的错误。它说有一个意外的T_CONSTANT_ENCAPSED_STRING错误,但我根本看不到它。
$dateResult = mysqli_query($connection, 'select county, cuisine,
count(*) from inspection, restaurant where inspection.rid =
restaurant.rid and inspection.passfail = ''PASS'' and idate like '$date%'
group by county, cuisine');
我假设它与我的模式'$ date%'或'PASS'有问题。
谢谢!
答案 0 :(得分:3)
尝试此操作您的邮件是'
和"
$dateResult = mysqli_query($connection, "select county, cuisine,
count(*) from inspection, restaurant where inspection.rid =
restaurant.rid and inspection.passfail = 'PASS' and idate like '$date%'
group by county, cuisine");