I have this line:
$sql = "UPDATE votes SET up=up+1 WHERE id='{$p}'"; Now from what I've read one way of sql injection is caused by not "closing" sql queries properly which allows hackers to add additional info.
So my question is, is that line safe as to me the up=up+1 has not been "closed" but if I set it like this up='up+1' which to me makes it "closed" it does not work.
row up type is int(11) if that makes any difference.
Update:
$p is sanitized with a function
function sanitize($foo) { if(get_magic_quotes_gpc() == true) { $foo = stripslashes($foo); } return mysql_real_escape_string(htmlspecialchars($foo)); }