Re: Problems with CONCAT function

2009-03-22 Thread brian
Or put it in your AppModel so you don't need to think about it again. On Sun, Mar 22, 2009 at 12:54 PM, mscdex wrote: > > On Mar 22, 5:43 am, Chrillemeter wrote: >> Thanks, it works. But it don't work when I use it with HABTM. > > Did you put the afterFind() fix code in just your User model? If

Re: Problems with CONCAT function

2009-03-22 Thread mscdex
On Mar 22, 5:43 am, Chrillemeter wrote: > Thanks, it works. But it don't work when I use it with HABTM. Did you put the afterFind() fix code in just your User model? If so, you'll need to also put it in your Group model or in your app_model.php (if you want the fix to automatically be used by al

Re: Problems with CONCAT function

2009-03-22 Thread Chrillemeter
Thanks, it works. But it don't work when I use it with HABTM. I have three tables users | groups | groups_users The habtm code in the model Group, looks like this public $hasAndBelongsToMany = array ( 'User' =>

Re: Problems with CONCAT function

2009-03-21 Thread mscdex
On Mar 21, 3:51 pm, Chrillemeter wrote: > Hello! > > I got a problem with $this->Model->find() and sql-functions such as > CONCAT. This is a known problem and it happens when using any SQL functions. Teknoid has a solution for this issue here: http://teknoid.wordpress.com/2008/09/29/dealing-with

Re: Problems with CONCAT function

2009-03-21 Thread Chrillemeter
No change at all. Get the same result. [0] => Array ( [0] => Array ( [full_name] => Christher Lenander ) ) On Mar 21, 10:00 pm, John Andersen wrote: > I haven't used this before, but reading the manual and che

Re: Problems with CONCAT function

2009-03-21 Thread John Andersen
I haven't used this before, but reading the manual and checking your code, I come up with this change: 'fields' => array( 'CONCAT( User.firstname, \' \', User.lastname ) AS full_name' ) There was a mismatching of the brackets, one was actually inside the CONCAT string. Hope this