我有一個複雜的查詢,這是再增加一個行前工作正常: 工作查詢:MySQL的語法錯誤
$query = "SELECT SQL_CALC_FOUND_ROWS *
FROM realestate
INNER JOIN users ON id_user = users.id
LEFT JOIN pic ON id_realestate = realestate.id
group by realestate.id
ORDER BY {$order}
LIMIT 0 , 10";
的$order
值date DESC
增加一個行後,這裏是查詢:
$query = "SELECT SQL_CALC_FOUND_ROWS *
FROM realestate
{$place}
INNER JOIN users ON id_user = users.id
LEFT JOIN pic ON id_realestate = realestate.id
group by realestate.id
ORDER BY {$order}
LIMIT 0 , 10";
$place
已將此值WHERE address =1
字段名address
在其他表中不重複。
我得到這個mysql
錯誤:
Database query failed: 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
'INNER JOIN users ON id_user = users.id LEFT JOIN pic ON id_realestate = real'
at line 4
你救了我的一天。非常感謝。 – 2012-02-03 01:52:51