1
我與教義有點問題。即時得到以下錯誤:學說 - PHP致命錯誤:'無法獲取最後一個插入標識符'。
PHP Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't get last insert identifier.'
我看了這個帖子,Doctrine Problem: Couldn't get last insert identifier,這是有益的,但我的問題是有點不同。
我在不應該有一個auto_increment主鍵的表上收到此錯誤。我的設置如下:
Event:
id:int, PK, auto_increment
User
id: int, PK, auto_increment
UserEvent:
user_id:int, PK
event_id: int, PK
我遇到了插入到UserEvent的問題。所以流程是,我在Event中插入一條記錄,然後向User中插入一條記錄,然後向UserEvent中插入一條記錄。
有趣的是,它插入所有這3個罰款。但插入最後一個(UserEvent)後,它會引發該錯誤。
任何想法?
有人對此有任何建議嗎? – djt 2011-06-07 18:19:48