1

I have 2 tables. Table1 contains a profile. Table2 contains user login details. The two tables are related by the same column: gurdianID. I want to get a single row from 'Table1' and 'Table2' where the 'gurdianID' matches in both the tables. i.e. Example gurdianID'='15001'.

I tried the following but it keeps giving me a MySQL error:

SELECT *
FROM  portalGurdian, gurdLogin
WHERE portalGurdian.guardID=gurdLogin.guardID
AND   portalGurdian.guardID='15001';

The Error Message is:

MySQL said: Documentation
#1267 - Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='

Any guidance on how to resolve this ?

Leigh
  • 28,765
  • 10
  • 55
  • 103
Fawaz Taj
  • 83
  • 1
  • 9
  • Just looking at the error, the problem sounds pretty self explanatory. Did you search first? A quick search turned up some promising threads/solutions. For example http://stackoverflow.com/questions/13285207/mysql-error-code-1267-illegal-mix-of-collations-latin1-general-cs-implicit – Leigh Feb 02 '15 at 18:40
  • (Edit) Never mind, I see you figured it out already. *RE: Lesson Learned: Read the error message carefully ...* Haha, yep. – Leigh Feb 02 '15 at 18:44

1 Answers1

2

I just did a search on the MySQL Error code and found that the collations were slightly different, and causing the issue.

I went ahead and made sure both the tables had the same collation ... i.e. 'utf8_general_ci'

Lesson Learned: Read the error message carefully ...

Fawaz Taj
  • 83
  • 1
  • 9