教义语法错误;/
我需要有关此代码的帮助:
$mdl = Doctrine_Query::create()
->update('Model_CoachsTownsLang ctl')
->set('ctl.Coachs_Users_id', '1')
->set('ctl.Towns_idTowns', '1')
->set('ctl.Langs_idLang', '2')
->set('ctl.title', $data['title'])
->set('ctl.active', $data['active'])
->set('ctl.description', $data['description'])
->set('ctl.modyfication', '1')
->set('ctl.modyfied_id', $userData['id'])
->set('ctl.permit', $data['permit'])
->where('ctl.Coachs_Users_id =?', $data['id'])
->execute();
ZFDebug 输出错误:
Doctrine_Connection_Mysql_Exception:SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;检查与您的MySQL服务器版本相对应的手册,以获取使用near'sdfg sdfg,active = 1,description = ...的正确语法,
但我查看了这段代码,没有发现语法错误。我指望你的帮助。
Tabla 向数据库添加结构:
CREATE TABLE IF NOT EXISTS `intelektualnie`.`CoachsTownsLangs` (
`id` INT NOT NULL AUTO_INCREMENT ,
`Coachs_Users_id` INT NULL ,
`Towns_idTowns` INT NULL DEFAULT NULL ,
`Langs_idLang` INT NULL DEFAULT NULL ,
`title` TEXT NULL DEFAULT NULL ,
`description` TEXT NULL DEFAULT NULL ,
`active` TINYINT(1) NOT NULL DEFAULT 0 ,
`modyfication` TINYINT(1) NOT NULL DEFAULT 0 ,
`modyfied_id` INT NULL DEFAULT NULL ,
`permit` TINYINT(1) NOT NULL DEFAULT 1 ,
PRIMARY KEY (`id`) ,
INDEX `fk_CoachsTownsLangs_Coachs1` (`Coachs_Users_id` ASC) ,
INDEX `fk_CoachsTownsLangs_Towns1` (`Towns_idTowns` ASC) ,
INDEX `fk_CoachsTownsLangs_Langs1` (`Langs_idLang` ASC) ,
CONSTRAINT `fk_CoachsTownsLangs_Coachs1`
FOREIGN KEY (`Coachs_Users_id` )
REFERENCES `intelektualnie`.`Coachs` (`Users_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_CoachsTownsLangs_Towns1`
FOREIGN KEY (`Towns_idTowns` )
REFERENCES `intelektualnie`.`Towns` (`idTowns` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_CoachsTownsLangs_Langs1`
FOREIGN KEY (`Langs_idLang` )
REFERENCES `intelektualnie`.`Langs` (`idLang` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
I need help with this code:
$mdl = Doctrine_Query::create()
->update('Model_CoachsTownsLang ctl')
->set('ctl.Coachs_Users_id', '1')
->set('ctl.Towns_idTowns', '1')
->set('ctl.Langs_idLang', '2')
->set('ctl.title', $data['title'])
->set('ctl.active', $data['active'])
->set('ctl.description', $data['description'])
->set('ctl.modyfication', '1')
->set('ctl.modyfied_id', $userData['id'])
->set('ctl.permit', $data['permit'])
->where('ctl.Coachs_Users_id =?', $data['id'])
->execute();
ZFDebug output error:
Doctrine_Connection_Mysql_Exception: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sdfg sdfg , active = 1, description =...
But I look at this code and I see no errors in syntax. I am counting on your help.
Tabla adds structure to the database:
CREATE TABLE IF NOT EXISTS `intelektualnie`.`CoachsTownsLangs` (
`id` INT NOT NULL AUTO_INCREMENT ,
`Coachs_Users_id` INT NULL ,
`Towns_idTowns` INT NULL DEFAULT NULL ,
`Langs_idLang` INT NULL DEFAULT NULL ,
`title` TEXT NULL DEFAULT NULL ,
`description` TEXT NULL DEFAULT NULL ,
`active` TINYINT(1) NOT NULL DEFAULT 0 ,
`modyfication` TINYINT(1) NOT NULL DEFAULT 0 ,
`modyfied_id` INT NULL DEFAULT NULL ,
`permit` TINYINT(1) NOT NULL DEFAULT 1 ,
PRIMARY KEY (`id`) ,
INDEX `fk_CoachsTownsLangs_Coachs1` (`Coachs_Users_id` ASC) ,
INDEX `fk_CoachsTownsLangs_Towns1` (`Towns_idTowns` ASC) ,
INDEX `fk_CoachsTownsLangs_Langs1` (`Langs_idLang` ASC) ,
CONSTRAINT `fk_CoachsTownsLangs_Coachs1`
FOREIGN KEY (`Coachs_Users_id` )
REFERENCES `intelektualnie`.`Coachs` (`Users_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_CoachsTownsLangs_Towns1`
FOREIGN KEY (`Towns_idTowns` )
REFERENCES `intelektualnie`.`Towns` (`idTowns` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_CoachsTownsLangs_Langs1`
FOREIGN KEY (`Langs_idLang` )
REFERENCES `intelektualnie`.`Langs` (`idLang` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试更改:
到
和:
到
Try changing:
to
and:
to