CodeIgniter Forums
Doctrine Column not found - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Doctrine Column not found (/showthread.php?tid=35254)



Doctrine Column not found - El Forum - 10-24-2010

[eluser]w84me[/eluser]
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...


Doctrine Column not found - El Forum - 10-24-2010

[eluser]kaejiavo[/eluser]
Hi,
have you created the new field offer_id in your user table?

Marco


Doctrine Column not found - El Forum - 10-24-2010

[eluser]w84me[/eluser]
Yes I did...


Doctrine Column not found - El Forum - 10-24-2010

[eluser]kaejiavo[/eluser]
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)

Marco


Doctrine Column not found - El Forum - 10-24-2010

[eluser]w84me[/eluser]
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...


Doctrine Column not found - El Forum - 10-24-2010

[eluser]w84me[/eluser]
:red: Actually it was the 2.

Thanks for pointing out!!!