$search_result = $mysqli->query("SELECT * FROM `social_users` WHERE id IN('{$num_contact}') AND name LIKE '%{$sname}%' OR name LIKE '%{$slastname}%' AND lastname LIKE '%{$slastname}%' OR lastname LIKE '%{$sname}%'");
$num_contact = '1,2,3';
$sname - текст
$slastname - тоже текст