我有一个使用内部联接进行搜索的查询,但浏览器显示语法消息错误
20你的SQL语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 17 行的 '= '' 或 village = '')' 附近使用正确的语法
谁能告诉我我的查询有什么问题???
询问:
$sql = mysql_query("SELECT user_id,first_name, last_name, birth_date, registered_date,
s.specialization_name,
g.governorate_name,
d.district_name,
v.village_name
FROM members u
INNER JOIN specialization s
ON u.specialization = s.specialization_id
INNER JOIN governorate g
ON u.governorate = g.governorate_id
INNER JOIN districts d
ON u.district = d.district_id
INNER JOIN village v
ON u.village = v.id
where (governorate = ''or governorate = '$bygov') or
(district = '' or district = '$bydist') or
(village = '' or village = '$byvillage')")
or die(mysql_error());