I am converting all my mysql stuff to mysqli and so far going pretty well...
i am having an issue with the code below where it gives me the following error
Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in
I didnt write this part of the code originally. i have tried taking it out and get alot more errors and taking different pieces of it out as well. The page loads and all of its data. should i make it so if null is given do something if not null do something
if (!isset($config_connection) || !$config_connection) {
$config_connection = mysqli_connect("$hostname", "$user", "$password", "$db");
}
if ( !function_exists('_safe'))
{
function _safe( $str = '' )
{
if ( !$str ) return;
if ( !is_numeric($str) ) {
if (get_magic_quotes_gpc())
$str = stripslashes($str);
$str = mysqli_real_escape_string($config_connection, $str);
var_dump($str);
}
return $str;
}
}