Mysql全文搜索当column1 = value1且Column2 = value2时

时间:2015-05-17 10:45:41

标签: php mysql full-text-search

我正在尝试使用 Full Text 搜索书桌  publisher -> exampleauthor -> test ...
publisher -> exampleauhtor -> testbookname -> another ...

我试过这个问题:

    $this->_query  = "SELECT " . $targetCol . " FROM " . $this->_dbName . "." . $this->_tableName . " WHERE ";
    $this->_query .= "MATCH(publisher) AGAINST('" . $pub . "') AND ";
    $this->_query .= "MATCH(author) AGAINST('" . $aut . "') ";

但这并不是正确的结果。
我在stackoverflow搜索并发现了类似的内容:

    $this->_query  = "SELECT " . $targetCol . " FROM " . $this->_dbName . "." . $this->_tableName . " WHERE ";
    $this->_query .= "MATCH(publisher, author) AGAINST('" . $pub . "', '" . $aut . "')";

但是这个也没有正确的结果。看来这些查询主要关注第一列publishre in my case

你能告诉我为什么吗?或者我的查询是否符合我的目标?

Thanks in advance

0 个答案:

没有答案
相关问题