Re: Encrypted text does not get saved in the db
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 <villa...@gmail.com> 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 <villa...@gmail.com> 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 <villa...@gmail.com> 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] => m...@gmail.com
> > > [msg] => This is a string
> > > )
>
> > > // After:
> > > // if($this->Message->save($this->data)){
> > > // die(debug($this->data));
> > > [Message] => Array
> > > (
> > > [to] => m...@gmail.com
> > > [msg] => ÙYÃu`ï·۹ñ$!ó]
> > > [user_id] => 1
> > > )
>
> > > On Nov 12, 7:46 pm, cricket <zijn.digi...@gmail.com> wrote:
>
> > > > On Fri, Nov 12, 2010 at 1:13 PM, laduree <villa...@gmail.com> 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home