I don't know what is going on with this but htmlentities() function is not working!
Here is what i have done
(the bottom code work correctly but htmlentities() does not convert quotes to html code! for example " should be change to some html5 code!
$term = "'" . addslashes($_GET['search_term']) . "%'";
if(!isset($term{2})){
exit();
}
$query = $db->query('SELECT customerID, fullName, dID, birthYear, homeAddress, ID, DATE_FORMAT(idIssue, "%d-%m-%Y") AS idIssue, DATE_FORMAT(idExp, "%d-%m-%Y") AS idExp, phone
FROM customers WHERE (fullName LIKE '.$term.' ) LIMIT 0,10');
while( $row = $query->fetch_assoc()){
foreach($row as $key => $value){
$arr[$key] = htmlentities(stripslashes($value), ENT_QUOTES);
}
$json[] = $arr;
}
echo json_encode($json);