mysql_real_scape_string for STRINGS . it will not make the whole "safe" to use. eg.
$safe = mysql_real_escape_string($_GET['page']);
will do nothing where
$_GET['page'] = "0 = 0";
because there are no SQL metacharacters. your request will be in something like
SELECT ... WHERE somefield = 0 = 0
However, if intval () converts this value 0=0 to regular 0 .
source share