[英]Unknown column in 'where clause?
I Have the following code of php 我有以下PHP代码
$query = sprintf("SELECT to_go.to_location FROM to_go
INNER JOIN to_location ON to_go.to_location_id = to_location.id
WHERE match(to_location ) against(%s)", mysql_real_escape_string($location));
i tried every thing but it keep output me that following error "Unknown column in 'where clause ?" 我尝试了所有的东西,但它继续输出我跟随错误“在where子句中的未知列?” i tried to change the names of the columns and still the same problem
我试图改变列的名称,仍然是同样的问题
match(to_location ) against
需要提供一个字段,而不是一个表:
match(to_location.id) against(something)
I guess you may need to replace 我想你可能需要更换
WHERE match(to_location )
with 同
WHERE match(to_go.to_location)
Since you have a column name the same name as a table name, MySql is probably confusing them and thinking match(to_location)
refers to the table. 由于您的列名与表名相同,因此MySql可能
match(to_location)
它们混淆,并且思考match(to_location)
指的是表。 Try using the fully-qualified column name, ie, table_name.column_name
. 尝试使用完全限定的列名,即
table_name.column_name
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.