Hi all:
I'm using MySQL 4.0.18, trying to run the mysql_escape_string on my form variables, and when I submit the form, I get this error one time for each var I'm apllying the string to:
Warning: Wrong parameter count for mysql_escape_string() in /home/souther2/public_html/register.php on line 18
Here's the code for the string:
// Create a function for escaping the data.
function escape_data ($data) {
global $dbc; // Need the connection.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_escape_string($data, $dbc);
} // End of function.
And here's how I'm applying it to the variables:
$fn = escape_data($_POST['first_name']);
Any ideas? Thanks in advance!
mysql_escape_string
Moderator: General Moderators
Code: Select all
// Create a function for escaping the data.
function escape_data ($data)
{
if (ini_get('magic_quotes_gpc'))
{ $data = stripslashes($data); }
return mysql_escape_string($data);
} // End of function.Cheers,
BDKR