Search code examples
phpsqlsql-injection

SQL Injection - is it possible when the variable is processed using intval()?


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.


Solution

  • No because intval will always just be a number. The same goes for (int).