I know that using PHP functions to avoid anti-sql injections is a bad idea, but I'm trying solve this function issue for custom purposes
function anti_injection($sql){
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"), "" ,$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = (get_magic_quotes_gpc()) ? $sql : addslashes($sql);
return $sql;
}
I'm getting this error: Uncaught Error: Call to undefined function sql_regcase()
How can I solve this?
Thank you.