I'm working on a project and am at a standstill. I've done a lot of searching around including sql documentation but can't find anything putting me in the right direction.
I've created a search form which when entering a name will show me a list of the users similar to the search term. The issue im having is that it also shows the user who's logged in and performing the search.
Here is my query -
$query = $pdo->prepare("SELECT id, first_name, last_name
FROM users
WHERE id <> " . $user['id'] . "
AND first_name LIKE '%$searchterm%'
OR last_name LIKE '%$searchterm%'
LIMIT 5");
Is my statement wrong?