这是我的代码:
$query = "SELECT * directory WHERE id ='$comId'";
echo $query;
$com_result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($com_result)) { // While I am finding agents.
以下是$ query等于:
SELECT * directory WHERE id ='4'
以下是我之后得到的内容:
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 'directory WHERE id ='4'' at line 1
答案 0 :(得分:9)
你只是缺少FROM
条款。
SELECT * FROM directory WHERE id ='4'