0

Could somebody correct this statement to stop sql injection, I have read through lots of answers but don't understand how to do it.

 $conn = new mysqli($servername, $username, $password, 
 $dbname);
 if ($conn->connect_error) {
 die("Connection failed: " . $conn->connect_error);
 } 

 $sql = "UPDATE daydxx SET $T1 ='$Dsc', $T2 = '$SV'  WHERE date = '$Dt' AND 
 $T1 = '' OR date = '$Dt' AND $T1 IS NULL ";

 if ($conn->query($sql) === TRUE) {  etc etc
Dai13
  • 13
  • 5

0 Answers0