<p>Error Number: 1271</p><p>Illegal mix of collations for operation 'like'</p>
SQL Code (PHP)
SELECT SQL_CALC_FOUND_ROWS title, created, visitors
FROM (`news`)
WHERE `title` LIKE '%ก%'
OR `created` LIKE '%ก%'
OR `visitors` LIKE '%ก%'
ORDER BY `title` asc
LIMIT 13
$srh='ก';
$sql = "
SELECT SQL_CALC_FOUND_ROWS title, created, visitors
FROM `news`
WHERE `title` LIKE '%$srh%' ".
(preg_match('/^\d{4}-\d{2}-\d{2}$/', $srh)? " OR `created` = '$srh' " : '' )."
OR `visitors` LIKE '%$srh%'
ORDER BY `title` asc
LIMIT 13
SELECT SQL_CALC_FOUND_ROWS title, created, visitors
FROM (`news`)
WHERE `title` LIKE '%ก%'
OR `created` LIKE '%ก%'
OR `visitors` LIKE '%ก%'
ORDER BY `title` asc
LIMIT 13