On Feb 14, 9:55 pm, cake-learner <[email protected]> wrote: > Very often i got this error and i had to do custom query why it's not > putting '*'? > > $this -> loadModel( 'Company.Role' ); > $this -> Role -> useDbConfig = $this -> db_name; > $arrRoles = $this -> Role -> find( "all" ); > > Warning (512): SQL Error: 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 'FROM `roles` AS `Role` WHERE 1 = 1' at > line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 535] > > Code | Context > > $sql = "SELECT FROM `roles` AS `Role` WHERE 1 = 1 "
Either you have overridden schema such that cake has no way of knowing what fields are in your roles table, or your db user doesn't have permissions to run describe, and find out for itself. If it's the latter: the FIRST db error message is the relevant one to ask for help with. AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
