Código PHP:
<?
$matricula = $_POST['matricula']//Suponiendo que estes enviando por Post los datos
$query = pg_exec($db_connec,"Select * from tutabla where matricula='$matricula'");
while ($query = pg_fetch_object ($qu, $row)){
echo $query->matricula;
echo $query>nombre;
.
.
.
$row++}
?>