How to save bad query? |
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?
@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?
@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.
(01-24-2019, 05:02 PM)php_rocs Wrote: @hgmflash123, 2.2.0 and Yes, I know the exact controller.
(01-24-2019, 05:05 PM)php_rocs Wrote: @hgmflash123, I hope CI has implement helpers or options which can save bad query. If not, I will make custom logic =(
@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. |
Welcome Guest, Not a member yet? Register Sign In |