I have an issue. I am searching the data from table by giving the letter as input using PHP and MySQL.Here i am facing some issue while searching. I am explaining my code below.
$searchKey=$_GET['searchKey'];
$keyword = $searchKey.'%';
$sql =mysqli_query($connect,"SELECT * FROM db_restaurant_basic WHERE rest_name LIKE '".$keyword."' and special='".$special_id."' and city='".$city_id."' and status=1 ORDER BY member_id DESC ");
Here if can putting the direct name then search functionality can work. Suppose I have one rest_name The Joyce
and I want to search this. When user is putting the name directly like The Joyce or The
then its working but if user is searching like this Joyce
only its not working but it should work. Similarly there is a another rest_name Toad 'n' Turtle
. If user will put Toad or 'n' or Turtle
it should work which is not working in my current case. Please help me to resolve this issue.