Oct

10

If you have been using the cakePHP 1.2 beta’s scarfold to bake (generate) your controller, when you go to the add article page, there will be an error message like the one below:

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 ‘generateList’ at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 512]

If this happens to you, then that means your cake baked the wrong version of CRUD code for you, to fix the problem, you first locate the controller file, my controller’s name is posts, so my controller file is located at: cake/app/controllers/posts_controller.php.

Looking for the code:
generateList();

It may appear more than once in your code, replace it with:
find('list');


Since CakePHP 1.2, the CakePHP 1.1 syntax generateList(); has been replaced by the powerful find(”).

Hope this helps! :)



Similar Posts

Comments

Name (required)

Email (required)

Website

Speak your mind

3 Comments so far

  1. Bill Goss on October 21, 2008 4:19 pm

    Incredible!

    I didn’t think that there was a solution I could find.

    How are you with zend eclipse?

    I can debug php scripts ok, but it chokes when I try to debug a controller with:
    class ‘controller’ not found

    If you don’t know the answer, I would sure appreciate a lead.

    Thanks again,

    Bill Goss

  2. admin on November 25, 2008 1:49 am

    Hi, Bill

    I am glad this post helps :)

    I am not so familiar with eclipse.

    cakephp has very bad error report, i also always receive: class ‘controller’ not found. The error message doesn’t make much sense, normally I will just have to dig into the cake or check the log for answer, hope this helps :)

  3. Fahad on November 28, 2008 5:31 am

    Thanks.
    Its really helpful

Sponsors




Links