I've been for hours trying everything to get a simple title with apostrophe insert on database... but it simple don't want to works.
I've always used the php function (below) and it used to work... but in this case it is not working at all.
I have the following:
$GameArray = mysql_fetch_array($QGame);
$FixTitle = PHP_slashes($GameArray['Title']); // should retrive "Assassin's Creed IV"
But it don't work. I don't understand why. If I post some content with apostrophe and do it like:
PHP_slashes($_POST['content_with_apostrophe']);
It works.
Below is the PHP_slashes()
function for reference.
function PHP_slashes($string,$type='add')
{
if ($type == 'add')
{
if (get_magic_quotes_gpc())
{
return $string;
}
else
{
if (function_exists('addslashes'))
{
return addslashes($string);
}
else
{
return mysql_real_escape_string($string);
}
}
}
else if ($type == 'strip')
{
return stripslashes($string);
}
else
{
die('error in PHP_slashes (mixed,add | strip)');
}
}