我正在尝试用LEFT JOIN在2张桌子上进行比赛

`jos_application_listing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `headline` text NOT NULL,
  `city` bigint(20) NOT NULL,
  `state` varchar(500) NOT NULL,
  `country` varchar(500) NOT NULL,
  `features` text NOT NULL,
  `listing_type` bigint(20) NOT NULL,
  `phone` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `website` varchar(1000) NOT NULL,
  `pictures` mediumtext,
  `address` varchar(100) NOT NULL DEFAULT '',
  `postal` varchar(25) NOT NULL DEFAULT '',
  `category` bigint(20) NOT NULL,
  `sub_category` bigint(20) NOT NULL,
  `latitude` float NOT NULL,
  `longitude` float NOT NULL,
  `listing_expire` varchar(255) NOT NULL DEFAULT 'normal',
  `featured_till` datetime NOT NULL,
  `facebook` text NOT NULL,
  `video` text NOT NULL,
  `video_size` text NOT NULL,
  `business_hours` text NOT NULL,
  `published` tinyint(4) NOT NULL,
  `featured` tinyint(4) NOT NULL,
  `UID` bigint(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

`jos_application_cities` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM CHARSET=utf8;


索引->>>

我在jos_application_listing上有一个全文索引(名称,标题,描述)



我在jos_application_cities(city)上有一个全文索引

查询->>>

SELECT * FROM jos_lnzon_listing
LEFT JOIN jos_lnzon_cities ON jos_lnzon_listing.city = jos_lnzon_cities.id
WHERE MATCH (name,headline,description,jos_lnzon_listing.city)
AGAINST ('" . $searchQuery . "' IN BOOLEAN MODE)";


我看不到此问题,但出现以下错误:

1271-操作'match'的排序规则的非法混合SQL = SELECT * FROM jos_lnzon_listing LEFT JOIN jos_lnzon_cities ON jos_lnzon_listing.city = jos_lnzon_cities.id WHERE MATCH(名称,标题,描述,jos_lnzon_listing.city)再次存在('+搜索词'模式)

最佳答案

我的排序规则错误的经验通常是字符编码不匹配的结果-您是否尝试过将连接字符集显式设置为UTF-8?

http://php.net/manual/en/mysqli.set-charset.php

我不知道在Joomla中这样做有多容易,恐怕:(。

您还可以检查列的排序规则,以查看它们确实是所有UTF-8:https://stackoverflow.com/a/10014869/994291

关于mysql - 1271-左联接上用于“匹配”操作的排序规则非法混合,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28078716/

10-10 18:21