I have a mysql database
that contain a table with 5 columns
a column has a name db_aya
contain Shaped letters like this
إِنَّ ٱلَّذِينَ كَفَرُواْ سَوَآءٌ عَلَيۡهِمۡ ءَأَنذَرۡتَهُمۡ أَمۡ لَمۡ تُنذِرۡهُمۡ لَا يُؤۡمِنُونَ
The user want to make a search on this column
I have an input field where the user can type the one or more words to make a search but the user is writting unshaped letters like this
إن الذين كفروا سواء
and in this situation the user get 0 result
How to solve this problem when the user type unshaped letters to get the result if exist in the database Note that in the above example the both are similar but one is shaped and the other is not
I tired this code:
<?php
include_once "../includes/connect.php";
$header = "content-type: application/json; charset=utf-8";
$search = mysqli_real_escape_string($conn, $_GET['search']) ;
$response = array();
// Check connection
if ($conn) {
$sql = mysqli_query($conn, "select db_id, db_aya from tbl_khire where db_aya LIKE '%$search%' order by db_id asc") or die(mysqli_error($conn));
if ($sql) {
header($header);
$i = 0;
while ($row = mysqli_fetch_array($sql)) {
$response[$i]['aya'] = $row['db_aya'];
echo $row['db_aya'];
$i++;
}
$json = json_encode($response, JSON_UNESCAPED_UNICODE);
echo $json;
}
} else {
echo "database connection failed";
}
?>