I had a function that escapes data before performing SQL statements. Now Problem is I have 4 databases, So how can I pass database object to function.
function escape($what)
{
global $db;
foreach ($what as $variable => $value)
{
if (is_string($value) || is_numeric($value))
{
$GLOBALS[$variable] = $db->real_escape_string();
}
else
{
$GLOBALS[$variable] = $value;
}
}
}
$GLOBALS? Have you heard of PDO?