tags:

views:

27

answers:

1

When I execute this query

SELECT * FROM login_table
WHERE username = 'sam'
  AND pass = AES_ENCRYPT('passabc', 'mystring') 

I keep on getting this error.

#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Thanks in advance for any help

A: 

expicetly cast to the correct collation. google your error - there are too many descriptions out there what to do!

or change your password-field from the table to the same collation as the result from AES_ENCRYPT returns (phpMyAdmin might be useful)

santa
I have got this solution for adding _latin1 infront of 'sam'SELECT * FROM login_tableWHERE username = _latin1'sam' AND pass = AES_ENCRYPT('passabc', 'mystring') but cant use _latin1 for pass fieldhow to change the collation of password fiel?
Parag Redkar
just google'd "mysql change collation column"...first result: http://dev.mysql.com/doc/refman/5.0/en/charset-column.html where it describes: ALTER TABLE tablename MODIFY columnname DATATYPE CHARACTER SET latin1 COLLATE latin1_your_collation
santa
Parag Redkar
nice 2 hear!!!!
santa