replaces mysql_real_escape_string with mysqli equivalent function