I have very short question, but no one asked it yet. Is it posible to do SQL injection in such piece of code?:
$number = intval($_GET["number"];
mysqli_query($link, "Select Username FROM Users WHERE USER_ID = $number");
Thank you.
I have very short question, but no one asked it yet. Is it posible to do SQL injection in such piece of code?:
$number = intval($_GET["number"];
mysqli_query($link, "Select Username FROM Users WHERE USER_ID = $number");
Thank you.
Thanks to using intval()
no, so you are fine.
But: mysql_query()
is deprecated (http://php.net/manual/en/function.mysql-query.php). Consider using MySQLi or PDO_MySQL.