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 wou
also, to use the function mysqli_real_escape_str, you need the mysqli , to get it
function get_mysqli() {
$db = (array)get_instance()->db;
return mysqli_connect('localhost', $db['username'], $db['password'], $db['database']);}
The above function returns a mysqli object such that you can use,
$escaped = mysqli_real_escape_string(get_mysqli(),$string);
It works well, not so important here though!