Thanks David, I am using 1.1.19.6305. I follow what you're saying
about the WHERE. When I changed find('all') to findAll(), it worked.

I am using 1.1.19.6305 because it appears to be the last stable
release. As a newbie, do you think it's ok for me to go with the edge
and use 1.2.0.7296 RC2? I guess by RC2 it should be stable enough.

-Ryan


On Sep 6, 12:50 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> What version of Cake are you using? The find('all', ...) syntax is  
> somewhat of a recent development. It certainly wasn't in Cake 1.1.  
> Seems to me you are using a version of Cake that expects the first  
> find() parameter to be the condition, hence it puts whatever you put  
> in there right after 'WHERE'. Look at the documentation for older  
> versions, or, better, get a recent version from the repository. Even  
> compared to the 1.2 RC2 release there are a lot new goodies in there  
> by now. Seehttps://trac.cakephp.org:
>
> svn cohttps://svn.cakephp.org/repo/branches/1.2.x.x/path/to/save
>
> On 6 Sep 2008, at 12:23, Ryan wrote:
>
>
>
> > Darrell: That's not my query, it's what CakePHP generated for me. I do
> > believe backticks are ok though.
>
> > David: Here is my posts_controller.php model (I took it verbatim from
> >http://book.cakephp.org/view/335/Create-a-Posts-Controller):
>
> > <?php
> >  class PostsController extends AppController {
> >    var $name = 'Posts';
> >    function index() {
> >      $this->set('posts', $this->Post->find('all'));
> >    }
> >  }
> > ?>
>
> > Thanks!
>
> > On Sep 5, 9:07 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> >> Seems to me you're using the wrong syntax in your $this->Model-
> >>  >find(***) call.
> >> Can you paste it in here?
>
> >> On 6 Sep 2008, at 07:02, Ryan wrote:
>
> >>> I am just getting started with Cake. Impressed so far! Trying out  
> >>> the
> >>> blog tutorial from the Cookbook (http://book.cakephp.org/view/219/
> >>> Blog) and getting this error.
>
> >>> Query: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`,
> >>> `Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` WHERE all
> >>> LIMIT 1
> >>> Warning: 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 'all LIMIT 1' at line 1 in /web/php/balistik/
> >>> cake/
> >>> libs/model/datasources/dbo_source.php on line 440
>
> >>> I am running MySQL 5.0.45. I thought Cake supported MySQL 4+ so  
> >>> seems
> >>> like I should be ok.
>
> >>> Thanks in advance for the help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to