It is strange that the log says there is not an INSERT query at all; however, the Message.to data is captured from the form and inserted in the db. And the 'created' and 'modified' fields are inserted automagically. The output from the SQL log is the following:
Nr Query Error Affected Num. rows Took (ms) 1 DESCRIBE `messages` 6 6 2 2 DESCRIBE `users` 6 6 3 3 1 1 4 SELECT LAST_INSERT_ID() AS insertID 1 1 0 I have the debug level set to 3 On Nov 12, 5:33 am, Amit Badkas <[email protected]> wrote: > Hi, > > I don't see any problem with the code. Have you looked at INSERT SQL query > by setting debug level to 2? > > Amit > > PHP Applications for E-Biz:http://www.sanisoft.comOn Fri, Nov 12, 2010 at > 2:43 AM, laduree <[email protected]> wrote: > > I have some data coming from a form, and I'm trying to encrypt part of > > it and save it in a mysql db. Everything gets saved, except the > > encrypted field, which is empty when I look in the database. > > > I'm new to CakePHP and wasn't successful googling for a solution, > > thanks for taking the time to read this. > > > /* > > * Encrypts and saves message > > */ > > function compose() { > > if(!empty($this->data)) { > > > $this->data['Message']['user_id'] = $this->Session- > > >read('Auth.User.id'); > > > // Encrypt message > > $security = new Security; > > > $this->data['Message']['msg'] = > > $security->cipher($this- > > >data['Message']['msg'], > > > Configure::read('Security.cipherSeed')); > > > // Save message > > if($this->Message->save($this->data)){ > > $this->Session->setFlash('Ok', 'flash_ok'); > > } else { > > $this->Session->setFlash('Error'); > > } > > } > > } > > } > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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]<cake-php%[email protected] > > om>For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en 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
