Added wrapper function for mysql_real_escape_string

This commit is contained in:
Dmitriy Simushev 2011-11-09 18:42:37 +00:00
parent 1cd6926f4f
commit a47e66a6a6

View File

@ -371,6 +371,14 @@ function close_connection($link)
}
}
function db_escape_string($string, $link = NULL)
{
if ( is_null($link) ) {
return mysql_real_escape_string($string);
}
return mysql_real_escape_string($string, $link);
}
function perform_query($query, $link)
{
mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));