Welcome Guest, Not a member yet? Register   Sign In
Doctrine Column not found

Hi all,

I've created a new field (offer_id) in my db and then I've entered it in my user model $this->hasColumn('offer_id','integer');

I keep getting this error though

Quote:Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'u.offer_id' in 'field list'.

It's driving me crazy...

have you created the new field offer_id in your user table?


Yes I did...

I made some tests and only get this error message, if the column is not in the db.
So i would check for these possible error sources
1. you have created the field in the wrong table by accident
2. you have created the field in the wrong database (e.g. dev db and CI is connecting to test db)
3. you have a typo in the field name
4. you have not applied the change to the database yet (happened to me a few times using mysql workbench)


I've tested all these with no luck. I've copied pasted the faulting query (reported in the error) in my SQLyog and it works fine...

:red: Actually it was the 2.

Thanks for pointing out!!!

Theme © iAndrew 2016 - Forum software by © MyBB