just curious - what is the field length of the passnum column?

  ----- Original Message ----- 
  From: Mark Wheeler 
  To: [email protected] 
  Sent: Friday, May 25, 2007 11:38 AM
  Subject: Re: [php_mysql] AES_DECRYPT syntax error problem


  Hi,

  I gave it a try and still the same syntax error. I can't see where 
  there is a problem. Could it be the way the table is created in the 
  database? I even made a test table with only the id and password and 
  still got the error. Here's what it looks like for the insert and 
  select statements.

  INSERT INTO test VALUES ('555',AES_ENCRYPT('123456789','fff'))

  SELECT `pid`, AES_DECRYPT(`passnum`, 'fff') AS `passnumdec` FROM 
  `test` WHERE `pid` = '555'

  No luck. What am I missing?!

  Thanks,

  Mark

  On May 25, 2007, at 2:22 AM, Tiago Relvão wrote:

  > Your query seems OK, but it might be your password field. Maybe you 
  > have to
  > use ``
  >
  > SELECT AES_DECRYPT(`password`, 'fff') AS `password_dec` FROM 
  > `table_name`
  > WHERE `user_id` = '555'
  >
  > just a guess anyway... Tiago
  >
  > On 5/25/07, Mark Wheeler <[EMAIL PROTECTED]> wrote:
  >>
  >> Hi,
  >>
  >> I'm beating my head against a wall here. I can not figure out where
  >> the syntax error is! Can anyone give me a helpful hint, please?
  >> Here's how I encrypted it and how I am trying to decrypt it.
  >>
  >> INSERT INTO table_name VALUES ('555',AES_ENCRYPT('abcdefg', 'fff'))
  >>
  >> SELECT AES_DECRYPT(password, 'fff') AS password_dec FROM table_name
  >> WHERE user_id = 555
  >>
  >> I don't get an error when inserting (or updating) but when I try to
  >> decrypt, I get a syntax error. Where is it?
  >>
  >> Thanks very much for any help,
  >>
  >> Mark
  >>
  >>
  >
  >
  > [Non-text portions of this message have been removed]
  >
  >
  >
  > The php_mysql group is dedicated to learn more about the PHP/MySQL 
  > web database possibilities through group learning.
  > Yahoo! Groups Links
  >
  >
  >



   

[Non-text portions of this message have been removed]

Reply via email to