if($_POST['country']){
$result = $pdo->pg_query("SELECT `name_doc` FROM `test_table` WHERE `number` = ".$_POST['name']."");
while ($row = $result->fetch_row()) {
printf ("%s (%s)\n", $row[0], $row[1]);
}
}
$pdo->close();
?>
$query = 'SELECT name FROM database';
$result = pg_query($query);
$myrow = pg_fetch_assoc($result, [$myVar = array()] );
$value = $myrow[name];
//echo "$value";
//echo "$word";
if ($value == "$word") {
$query2 = 'SELECT path FROM documents';
$result2 = pg_query($query2);
$myrow2 = pg_fetch_assoc($result2, [$myVar = array()]);
$value2 = $myrow2[path];
echo "$value2";
} elseif ($value <> $word) {
echo "pozshral";
}