0

As questioned above how can I prevent sql injection by third party if my query for JQuery autocomplete using ajax.

enter image description here

Ajax call:

$result = mysql_query("SELECT  patient_name FROM patient where patient_sex like '%Female%' and patient_name LIKE  '%".strtoupper($len)."%'");   
$data = array();
while ($row = mysql_fetch_array($result)) {
    array_push($data, $row['patient_name']);    
}   
echo json_encode($data);
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Vilas
  • 837
  • 2
  • 15
  • 41

0 Answers0