yii 2011-03-03 16:51:28 5061次浏览 4条回复 0 0 0

此错误如何解决?

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '40250f2000002' for key 'PRIMARY'
  • 回复于 2011-03-03 17:34 举报

    请把你的代码贴出来!let me see:

  • 回复于 2011-03-04 10:09 举报

    我已经解决了,多谢关注:P

  • 回复于 2012-01-18 09:59 举报

    CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'themeId' in where clause is ambiguous 这个问题怎么解决。themeId是主键来的

  • 回复于 2012-01-18 10:28 举报

    问题是在关联的过程中theme表自动生成别名为t,
    直接用theme.themeId造成不明确,
    因为很多表有themeId这个字段,
    我添加别名t上去就Ok了, $criteria->addCondition('t.themeId='.$themeId)

您需要登录后才可以回复。登录 | 立即注册