Welcome Guest, Not a member yet? Register   Sign In
How to save bad query?
#1

My site is under attack, so, I can see in logs detailed mysql error :  
Code:
Query error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

But it doesnt help me to recognise the error. I want see full sql query.
How can I store all bad queries?
Reply
#2

@hgmflash123,

What version of CI are you using? You have checked the logs. Do you know the exact controller that handles the page where the error is given?
Reply
#3

@hgmflash123,

You could dump any executed queries in your models to the CI log file. I would only do this for development/testing not Production.
Reply
#4

(01-24-2019, 05:02 PM)php_rocs Wrote: @hgmflash123,

What version of CI are you using?  You have checked the logs.  Do you know the exact controller that handles the page where the error is given?

2.2.0 and Yes, I know the exact controller.
Reply
#5

(01-24-2019, 05:05 PM)php_rocs Wrote: @hgmflash123,

You could dump any executed queries in your models to the CI log file. I would only do this for development/testing not Production.

I hope CI has implement helpers or options which can save bad query. If not, I will make custom logic =(
Reply
#6

@hgmflash123,

Wow! You are running an unsupported version of CI. If you are not in a crunch to get the site up then I would highly recommend that you upgrade the CI to the supported version (https://codeigniter.com/user_guide/searc...ea=default).

There are a couple of things that you might be able to do.

1. You can dump the generated query that is being called into the CI log. You will need to do this in the model that is executing the SQL code.
2. You could see if it is possible to see the PHP / Apache error log files.
3. If you have a copy of the software...you could develop an test environment and see if you can recreate the error.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB