Hi there, I'm using this little bit of code:
The $id just contains a number, in fact any number that I care to put into it, but for some reason when the 2nd isn't commented out, it empties the variable?
I've paired the script right down so that is literally all that is left PHP wise.
If I remove the 2nd line, it displays whatever is in the $id. If I change mysql_real_escape_string to strip_slashes, then it works. :s
Just wondering if anyone can help? I've got to be missing something, I've never had a problem like this before.
Code:
$id = $_REQUEST['id'];
$id = mysql_real_escape_string($id);
echo $id;
The $id just contains a number, in fact any number that I care to put into it, but for some reason when the 2nd isn't commented out, it empties the variable?
I've paired the script right down so that is literally all that is left PHP wise.
If I remove the 2nd line, it displays whatever is in the $id. If I change mysql_real_escape_string to strip_slashes, then it works. :s
Just wondering if anyone can help? I've got to be missing something, I've never had a problem like this before.

Last edited: