-1

我在 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附近有什么问题?

请帮忙

4

2 回答 2

1

您的 $subject 变量设置为subject='pcyear=393

于 2012-11-17T12:13:01.517 回答
1

我敢打赌,如果你回去,echo $subject你会得到pcyear=393

检查并确保$subject正确分配。

于 2012-11-17T12:13:58.300 回答