public static function escMySQL($value, $conn)
{
if (Inspekt::isArrayOrArrayObject($value)) {
return Inspekt::walkArray($value, 'escMySQL');
} else {
//no explicit func to check if the connection is live, but if it's not $conn would be false
if (is_resource($conn)) {
return mysqli_real_escape_string($conn, $value);
} else {
throw new UnexpectedValueException("Connection passed is not a valid resource");
}
}
}