Raised This Month: $68 Target: $400
 17% 

[SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) [solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
heavyisgps
Member
Join Date: Aug 2018
Old 09-04-2019 , 16:34   [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) [solved]
Reply With Quote #1

This is the error when attempting to view the Teams&Actions page of a player.

(1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='

The attempted SQL code

Code:
		SELECT
			IFNULL(hlstats_Roles.name, hlstats_Events_ChangeRole.role) AS name,
			IFNULL(hlstats_Roles.code, hlstats_Events_ChangeRole.role) AS code,
			COUNT(hlstats_Events_ChangeRole.id) AS rolecount,
			ROUND(COUNT(hlstats_Events_ChangeRole.id) / IF(110 = 0, 1, 110) * 100, 2) AS percent,
			hlstats_Frags_as_res.killsTotal,
			hlstats_Frags_as_res.deathsTotal,
			ROUND(hlstats_Frags_as_res.killsTotal / IF(hlstats_Frags_as_res.deathsTotal = 0, 1, hlstats_Frags_as_res.deathsTotal), 2) AS kpd
		FROM
			hlstats_Events_ChangeRole
		LEFT JOIN
			hlstats_Roles
		ON
			hlstats_Events_ChangeRole.role = hlstats_Roles.code
		LEFT JOIN
			hlstats_Frags_as_res
		ON
			hlstats_Frags_as_res.role = hlstats_Events_ChangeRole.role
		WHERE
			hlstats_Events_ChangeRole.playerId = 137
			AND
			(
				hidden <> '1'
				OR hidden IS NULL
			)
			AND hlstats_Roles.game = 'tf'
		GROUP BY
			hlstats_Events_ChangeRole.role
		ORDER BY
			rolecount desc,
			name desc
Any ideas on how to fix this? I searched the forum and couldn't find anything on this particular error.

I've looked over the tables and I can't find any table that has utf8mb4_general_ci, everyone has utf8mb4_unicode_ci as far as I can tell.

Last edited by heavyisgps; 09-21-2019 at 20:12.
heavyisgps is offline
bongotrommler
Member
Join Date: Feb 2013
Location: GG-Elite.Net
Old 09-17-2019 , 15:43   Re: [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ..
Reply With Quote #2

check the structure of th table,too ;)
bongotrommler is offline
heavyisgps
Member
Join Date: Aug 2018
Old 09-21-2019 , 20:06   Re: [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ..
Reply With Quote #3

Quote:
Originally Posted by bongotrommler View Post
check the structure of th table,too ;)
None of my tables are anything but utf8mb4_unicode_ci and I don't have any 'th' table.

EDIT:

Thanks, I got what you meant, my database itself was set to general and not unicode, not sure how that happened, but thanks for the tip!

Last edited by heavyisgps; 09-21-2019 at 20:12.
heavyisgps is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:02.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode