我在php中有一个mySQL查询:
$query = "SELECT serial FROM code WHERE type='".$type."' AND year='".$year."' AND subject='".$subject."' AND mounth='".$mounth."' AND day='".$day."' ORDER BY serial DESC LIMIT 1";
当我回应它时(出于调试目的)我看到了:
SELECT serial FROM code WHERE type='in' AND year='391' AND subject='pcyear=393' AND mounth='04' AND day='1' ORDER BY serial DESC LIMIT 1
subject ='pcyear = 393 附近有什么问题?
请帮助
答案 0 :(得分:1)
您的$ subject变量设置为subject='pcyear=393
。
答案 1 :(得分:1)
我打赌如果你回去echo $subject
你会得到pcyear=393
检查并确保正确分配$subject
。