This topic is locked

PHP ERROR HAPPENED

11/27/2018 11:54:38 AM
PHPRunner General questions
D
Danny KK Cheah author

Hi All,
I have been facing this problem of PHP Error happened but am not able to find a solution for it. Can anyone point me to a solution that works instead of an inspiration for me to solve the problem.
Technical information

Error type 256

Error description Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<'
I have googled to find a solution for Error type 256 but none came out for the same error code I'm facing. I have been given this link by support for inspiration to solve the problem I'm facing. https://stackoverflow.com/questions/31130841/error-number-1267-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-u
I tried but nothing works.
Any help would be much appreciated. I'm hoping to get some real help here since this is a community forum.
Thanks in advance.
Regards

Danny.

HJB 11/27/2018

https://stackoverflow.com/questions/11770074/illegal-mix-of-collations-utf8-unicode-ci-implicit-and-utf8-general-ci-implic?rq=1
quote excerpt
A bit similar to @bpile answer, my case was a my.cnf entry setting collation-server = utf8_general_ci.

After I realized that (and after trying everything above), I forcefully switched my database to

utf8_general_ci instead of utf8_unicode_ci and that was it:
ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci;
unquote
... for inspiration purposes only ...

D
Danny KK Cheah author 11/27/2018



https://stackoverflow.com/questions/11770074/illegal-mix-of-collations-utf8-unicode-ci-implicit-and-utf8-general-ci-implic?rq=1
quote excerpt
A bit similar to @bpile answer, my case was a my.cnf entry setting collation-server = utf8_general_ci.

After I realized that (and after trying everything above), I forcefully switched my database to

utf8_general_ci instead of utf8_unicode_ci and that was it:
ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci;
unquote
... for inspiration purposes only ...


I have tried ALTER DATABASE db CHARACTER SET utf8 COLLATE utf8_general_ci; and still doesn't work.
Error type: 256

Error description: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,NUMERIC) for operation '<'

URL: www.qeventspace.com/qstay/roombooking_print.php?

Error file: /home/qeventsp/public_html/qstay/connections/Connection.php

Error line: 661

SQL query SELECT RoomID, LevelID, RoomTypeID, BedTypeID, RoomCode, RoomNo, RoomStatusID, KeyQty, MKeyQty, HouseKeepingID, UserID, ActiveID, CreateDate, DateModified FROM room WHERE ( ( RoomID = 32 and ((ActiveID = 1) and RoomID NOT IN ( select R.RoomID FROM room AS R LEFT JOIN roombooking AS RB ON R.RoomID = RB.RoomID WHERE (RB.CheckInDate <= '' AND '' < RB.CheckOutDate) OR (RB.CheckInDate < '' AND '' <= RB.CheckOutDate) OR ('' <= RB.CheckInDate AND RB.CheckInDate < '') OR ('' < RB.CheckOutDate AND RB.CheckOutDate <= ''))) ) )

HJB 11/27/2018

https://www.youtube.com/watch?v=b7_J6Pfje4k
... a video on how to do it under PHPMyAdmin, found within the control panel.

admin 11/27/2018

It happens because of incorrect database setup. You will need to fix it right in the database. Check this for inspiration:

https://stackoverflow.com/questions/31130841/error-number-1267-illegal-mix-of-collations-latin1-swedish-ci-implicit-and-u