Hi, The first line of you edit function has a mistake.
should be $this->Post->id = $id; Good luck! On Jul 9, 11:13 pm, BlaineRumsey <[email protected]> wrote: > Hello, I am new to cake and I am trying to complete the blog tutorial > in the manual for 1.3 for getting started. I am at the edit post > section and I am having a problem. When I click edit I get and sql > syntax 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 'edit' at line 1 > > the output sql query is : > > SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, > `Post`.`modified` FROM `posts` AS `Post` WHERE `Post`.`id` = 1 LIMIT 1 > > which when pasted into the sql cmd editor in myadmin comes out fine no > errors. > > can anyone help me out here? > > details: > > php 5.2.4 > mysql 5.0.24a > > here is my edit function > > function edit($id){ > $this->Post->edit($id); > if(empty($this->Post->data)){ > $this->data = $this->Post->read(); > }else{ > if($this->Post->save($this->data)){ > $this->Session->setFlash('Your post has been > updated.'); > $this->redirect(array('action'=>'index')); > } > } > } > > I appreciate the help. > > BlaineRumsey Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
