I try to create search system using php and sql current condition is working fine but if I want to search for John Doe (firstname + lastname) nothing happens. I try the + between firstname and lastname but it did not work.
Condition is here:
 if(isset($_POST["query"])){
   $search = mysqli_real_escape_string($conn, $_POST["query"]);
   $query = "
   SELECT * FROM users
   WHERE firstname LIKE '%".$search."%'
   OR lastname LIKE '%".$search."%'
 ";
}
 
    