MYSQL提供了奇怪的错误消息

时间:2015-11-02 11:27:35

标签: php email magento zend-framework plugins

出于某种原因,如果我在我的数据库中提交“Nováobjednávkapronávštěvníka”,则会导致出现此错误消息。我确实在数据库中注意到它是否输入数据库,一些字符被替换为?。

保存此配置时发生错误:SQLSTATE [HY000]:常规错误:1267操作'='非法混合归类(latin1_swedish_ci,IMPLICIT)和(utf8_general_ci,COERCIBLE),查询为: SELECT Job_Id,tablename_colummname,email_template,days FROM Envato_CustomConfig_Job WHERE tablename_colummname =:tablename_c AND email_template =:email AND days =:days AND timeStamp =:timeStamp AND Job_Id!=:id LIMIT 1;

继承人我用来创建表的SQL。

DROP TABLE IF EXISTS {$this->getTable('Envato_CustomConfig_Job')};
CREATE TABLE {$this->getTable('Envato_CustomConfig_Job')} (
  `Job_Id` int(11) NOT NULL AUTO_INCREMENT,
  `tablename_colummname` varchar(100) NOT NULL,
  `email_template` varchar(100) NOT NULL,
  `days` INT(2) NOT NULL,
  `timeStamp`  varchar(100) NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`Job_Id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

1 个答案:

答案 0 :(得分:0)

将BINARY添加到您的WHERE-Clause中,例如:

WHERE BINARY tablename_colummname = BINARY :tablename_c

我希望这会有所帮助: - )