I have code igniter installed on server with database I want to run the same db on my mac, I used MAMP and I copy the project folder inside htdocs, but I have this error would you please help me!
ErrorException [ 8192 ]: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead.
It's not goot idea edit core CI files. If you don't want see deprecated warnings from
mysql_escape_string
, to usemysql_real_escape_string()
instead you need open connection with DB. Usedb->initialise()
in your base controllertry this:
I have update the answer
also, to use the function mysqli_real_escape_str, you need the mysqli , to get it
The above function returns a mysqli object such that you can use,
It works well, not so important here though!
Try this
Don't be afraid to change core files, just alter FCPATH/system/database/drivers/mysqli/mysqli_driver.php
I had the same issue
Better solution -> https://ellislab.com/forums/viewthread/228288/
"stated in github that it will be fixed in CodeIgniter 3.0 the fix already exists in that repository"