$join = $connect->query("SELECT * FROM `table1` AS `t1` LEFT JOIN `table2` AS `t2` ON `t1`.`id` =`t2`.`name`;");
$join = $join->fetch_assoc();
$podzap = $connect->query("SELECT * FROM `table1` WHERE `id`='".$join['famyli']."';");
$podzap = $podzap->fetch_assoc();
echo $join['fio'] $podzap['fio'] $join['otchestvo'];