Quantcast
Viewing latest article 9
Browse Latest Browse All 10

Cakephp Pagination Count Problem when using bindModel

Cakephp Pagination Count Show an Error like bellow:

Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Point.country_id' in 'where clause'

This occurs it can’t find relation with the point table which i add by using bindModel. After googling i find the exact cause of this problem. Bellow the details.

If we use bindModel after a call of find method, then model gets unbinded. we need to add a boolean false, like this:
$this->Table->bindModel(array(…),false).

This way it will still be binded after the paginateCount call.


Viewing latest article 9
Browse Latest Browse All 10

Trending Articles