$quary = "SELECT * FROM tab1 LEFT JOIN tab2, $zapros USING(p)";
+------------+----------+
| Field | Type | p |
+------------+----------+
| Id | int(11) | 30 |
| Name | char(35) | 22 |
| Country | char(3) | 1 |
| District | char(20) | 421 |
| Population | int(11) | 11 |
+------------+----------+
th1 = array(type=>array(int11,char35,char3 и т.д))
th2 = array(p=>array(30,22,1,421,11)
foreach ($all as $row) echo $row['Type'];
foreach ($all as $row) echo $row['Field'];
$stolbets = $pdo->($query)->fetchAll(PDO::FETCH_COLUMN);