<?php

foreach ($first as $count){
$str_sql_query = "SELECT id FROM dbCountries WHERE name LIKE '%$count%' OR alias LIKE '%$count%' ";
$countrysId = mysql_query($str_sql_query, $link);
}