model query trouble

2006-06-24 Thread EvgenP

Hello!

I have this in my model:
return $this-execute('SELECT COUNT (*), manufacturers.id,
manufacturers.name FROM manufacturers LEFT JOIN products ON
manufacturers.id=products.manufacturer_id GROUP BY
products.manufacturer_id');

this code works fine in phpMyAdmin, but cake

debug info:

SELECT COUNT (*), manufacturers.id, manufacturers.name FROM
manufacturers LEFT JOIN products ON
manufacturers.id=products.manufacturer_id GROUP BY
products.manufacturer_id

1064: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '(*), manufacturers.id, manufacturers.name FROM manufacturers LEFT
JOIN products ' at line 1


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: model query trouble

2006-06-24 Thread EvgenP

Sorry, my fault! there was a space between COUNT and (*)

))


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---