0

I am running this query

SELECT 
    friends.*, users.username, users.profile, users_groups.id
FROM 
    friends, users, users_groups 
WHERE 
    friends.uid=$logged_id AND friends.who=users.id 
    AND
        (
            users.username LIKE '%$search%' OR
            users.first_name LIKE '%$search%' OR
            users.last_name LIKE '%$search%'
        )
LIMIT 
    $start, $min

however I am receiving this:

Error Number: 2013

Lost connection to MySQL server during query

If I remove the LIKE statements from the query it works

user3023421
  • 333
  • 1
  • 7
  • 16

1 Answers1

0

Maybe it's a large table and LIKEs provoke a timeout.

Andres
  • 10,561
  • 4
  • 45
  • 63