Search bar - Illegal mix of collations for operation 'match'

Рейтинг: 0Ответов: 1Опубликовано: 09.02.2015

Привет, я пытаюсь использовать поисковую бар match for goods_id or name, но когда я использую оба B match() я получаю эту проблему

"Illegal mix of collations (latin1_swedish_ci,NUMERIC) and (utf8_general_ci,IMPLICIT) for operation 'match'" name - utf8_general_ci и FULLTEXT index goods_id - primary key AUTO INCRE. code: mysql:

function search(){
    $search = clear($_GET['search']);
    $result_search = array();

if(mb_strlen($search, 'UTF-8') < 1){
$result_search['notfound'] = "<div class='error'>min. 1 Letters</div>";
}else{
$query = "SELECT goods_id, name, img, price, hits, new, sale
FROM goodsbase
WHERE MATCH(goods_id, name) AGAINST('{$search}*' IN BOOLEAN MODE) AND 
visible='1'";
$res = mysql_query($query) or die(mysql_error());

if(mysql_num_rows($res) > 0){
while($row_search = mysql_fetch_assoc($res)){
$result_search[] = $row_search;
}
}else{
$result_search['notfound'] = "<div class='error'>NO MATCH!!!</div>";
}
}

return $result_search;
}

CREATE TABLE `goodsbase` (  `goods_id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT,  `name` varchar(255) NOT NULL,  `keywords` varchar(255) NOT NULL,  `description` varchar(255) NOT NULL,  `img` varchar(255) NOT NULL,  `goods_brandid` tinyint(3) unsigned NOT NULL,  `anons` text NOT NULL,  `content` text NOT NULL,  `visible` enum('0','1') NOT NULL DEFAULT '1', `new` enum('0','1') NOT NULL DEFAULT '0',  `price` float NOT NULL DEFAULT '0',  `date` date NOT NULL,  `img_slide` varchar(255) DEFAULT NULL,  PRIMARY KEY (`goods_id`),  FULLTEXT KEY `name` (`name`)) ENGINE=MyISAM AUTO_INCREMENT=45 DEFAULT CHARSET=utf8

Ответы

Ответов пока нет.