Как решить Неверную смесь параметров сортировки (latin1_general_ci, IMPLICIT)

Я пытаюсь обновить записи в таблице MySQL, но у меня возникает следующая ошибка.

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='' 

вот мой запрос

$db->processQuery('UPDATE account_mids SET price_sheet_file = ? WHERE mid = ? AND price_sheet_file IS NULL', array($filename, $mid));   

Я пытался добавить разбор, но не получилось. Это то, что я сделал

$db->processQuery('UPDATE account_mids SET price_sheet_file = ?  COLLATE utf8_general_ci    WHERE mid = ? COLLATE latin1_general_ci AND price_sheet_file IS NULL', array($filename, $mid)); 

но я получил следующую ошибку

Syntax error or access violation: 1253 COLLATION 'latin1_general_ci' is not valid for CHARACTER SET 'utf8''

Вот мое шоу создать таблицу

CREATE TABLE `account_mids` (
 `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
 `program_name` varchar(60) DEFAULT NULL,
 `mid` char(16) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
 `stage` enum('Engaged','Pricing','Application Sent','Application Incomplete','No Sale','Pending Admin Approval','Admin Rejected','Admin Approved','Submit to PTC','Waiting PTC Decision','Approved','Declined','On Hold','Withdrawn','Cancelled','Change of Program') NOT NULL,
 `type` enum('Existing Business','New Business','New Prospect','Change of Ownership','Program Transfer') NOT NULL,
 `chapter_name` varchar(80) DEFAULT NULL,
 `account_id` int(11) unsigned NOT NULL,
 `agent_code` varchar(8) DEFAULT NULL COMMENT 'the 10th and 11th char in mid value plus 00 it will equal out 4 chars',
 `prin_code` varchar(8) DEFAULT NULL COMMENT 'the 7th 8th and 9th char in the mid plus 0 on the right which is equal to 4 chars',
 `price_sheet_file` varchar(30) DEFAULT NULL,
 `created_on` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `status` tinyint(1) NOT NULL DEFAULT '1',
 `closed_reason` varchar(1000) DEFAULT NULL,
 `closed_on` datetime DEFAULT NULL,
 `approved_on` datetime DEFAULT NULL,
 `enrolled_on` date DEFAULT NULL,
 `training_requested_on` datetime DEFAULT NULL,
 `first_sale_on` datetime DEFAULT NULL,
 `speciality` varchar(255) DEFAULT NULL,
 `created_by` int(11) unsigned NOT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `mid` (`mid`),
 KEY `account_id` (`account_id`,`status`),
 CONSTRAINT `am_account_id` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`account_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=384010 DEFAULT CHARSET=utf8

Как я могу решить эту проблему?

Спасибо

Ответы на вопрос(2)

Ваш ответ на вопрос