Codeigniter and Doctrine 500 internal error

让人想犯罪 __ 提交于 2019-12-12 05:42:19

问题


I've tried to combine Doctrine with Codeigniter and I'm almost there, I think. The version of Codeigniter is 2.0.2 and from Doctrine is 2.0.0.

The problem is now that I get an 500 internal server error using the flush() method of Doctrine.

I am following a tutorial (http://wildlyinaccurate.com/integrating-doctrine-2-with-codeigniter-2/) to install doctrine with codeigniter. But at the last step it just fails and I don't know why.

This is my code in my controller:

$app = new models\application;
$app->setName("Test applicatie");
$app->setGuid();

$this->doctrine->em->persist($app);
$this->doctrine->em->flush(); //If I comment this out, it loads the view...

$this->load->view('welcome_message');

When I comment out the flush method it loads the view.

Thanks in advance.


回答1:


Well, since $this->doctrine->em->flush(); is what actually does the write to the DB, Make sure you have the required MySQL user rights to do the DB action.

Write the query directly in MySQL and make sure that the error isn't thrown there.




回答2:


Make sure to put some content in fields that cannot be null.



来源:https://stackoverflow.com/questions/6101691/codeigniter-and-doctrine-500-internal-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!