just playing by ear here, but are you certain that your database field
is defined with the right type and length to hold the data you are
trying to put in?

David

On 13 nov, 03:35, laduree <[email protected]> wrote:
> So, after trying everything I could think of, I baked a new project
> with as fewer code as possible, and I am able to insert an encrypted
> value in the database without any problem.
>
> I don't know what was causing the problem. I'll keep testing
> tomorrow.
>
> Thanks for all who took the time to read and help me.
>
> On Nov 12, 9:44 pm, laduree <[email protected]> wrote:
>
> > I tried running the query manually with $this->Message->query() and
> > the same happens, it will work correctly when a value is not encrypted
> > or with a hardcoded value, but will not work with encrypted values, it
> > leaves that field in the database empty.
>
> > On Nov 12, 7:57 pm, laduree <[email protected]> wrote:
>
> > > I did that and the data is there, if I hardcode a value it is entered
> > > correctly in the database, if I don't encrypt it it is entered
> > > correctly as well. It seems mysql is just not accepting the encrypted
> > > string.
>
> > > // After:
> > > // if(!empty($this->data)) {
> > > //     die(debug($this->data));
> > > [Message] => Array
> > >         (
> > >             [to] => [email protected]
> > >             [msg] => This is a string
> > >         )
>
> > > // After:
> > > // if($this->Message->save($this->data)){
> > > //     die(debug($this->data));
> > > [Message] => Array
> > >         (
> > >             [to] => [email protected]
> > >             [msg] => ÙYÃu`ï·۹ñ$!ó]
> > >             [user_id] => 1
> > >         )
>
> > > On Nov 12, 7:46 pm, cricket <[email protected]> wrote:
>
> > > > On Fri, Nov 12, 2010 at 1:13 PM, laduree <[email protected]> wrote:
> > > > > I tried using Security::cipher and the same thing happened with the
> > > > > same SQL output.
>
> > > > > The weirdest thing is that the data is not going missing at any point
> > > > > as I had passed it to the view using $this->set() both before and
> > > > > after encryption with the following result:
>
> > > > > Message: This string will be encrypted
> > > > > Encrypted message: T j/ ު޶ l3 ] *RS I+ } Wl
>
> > > > Try:
>
> > > > if(!empty($this->data)) {
> > > >     die(debug($this->data));

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

Reply via email to