<?php

foreach ($matches as $cont){
	$x= $cont;
$str_sql_query = "SELECT id FROM dbCountries WHERE name LIKE '%$x%' OR alias LIKE '%$x%' ";

$result = mysql_query($str_sql_query, $link))

while ($line = mysql_fetch_array($result, MYSQL_BOTH)) {
    echo "$line[0]\n";
  

}
}