I am new to php, but I am more familiar with SQL. So I'll give you the SQL code, and you enter it into your php code.
select *
from products
where name in x
x = a single quoted, comma delimited list such as: 'smith','jones','taylor'
in addition, a query that returns a single column from multiple records is also useable. If $result would return lastname, for three records, and you know it is the search criteria that you want, you could write this:
select *
from products
where name in ($result)
That may not be correct $result php syntax, but the SQL syntax is correct.