0
How can I prevent SQL Injection in this case?
<?php
//==== GET URL PARAMETER
$urlParam = $_GET['u'];
$sql = "SELECT email FROM `users` WHERE keystring = '$urlParam'";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
Utilize
mysqli_real_escape_string
or use Prepared Statment.– Inkeliz
Where should I put "mysqli_real_escape_string" ?
– Vitor Freitas
Hello Victor, here’s how to prevent sqlinjection: How to prevent SQL code injection into my PHP code?.
– Guilherme Nascimento