开发者

Codeigniter and Doctrine 500 internal error

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, 开发者_StackOverflow社区it loads the view...

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

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

Thanks in advance.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜