确切的错误消息是:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where rfflag='0'' at line 1
嗨,
我试图让一些 php 脚本正常工作,但它因上述错误消息而终止。 SQL 查询中有两个位置使用 rfflag:
$_SESSION['lang']=$objTerm->my_get_one("select min(id) from "
.$objTerm->TABLE['languages']." where status='1' and rfflag='0'");
$rs_lang=$objTerm->execute_query("select id,language from "
.$objTerm->TABLE['languages']." where `status`='1' and `rfflag`='0'");
如何确定是哪个问题引起的?或者问题完全是别的什么?
最佳答案
回显这个:
"select id,language from ".$objTerm->TABLE['languages']." where status='1' and rfflag='0'"
还有这个:
"select min(id) from ".$objTerm->TABLE['languages']." where status='1' and rfflag='0'"
然后在您最喜欢的 SQL Developer 工具中运行执行每个输出。 错误将显示在那里。
关于PHP MYSQL 错误 - “您的 SQL 语法有错误;检查...附近使用的正确语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3724001/