Kapcsolati Informaciok";
echo 'Database name: ' . pg_dbname($db) . "
";
echo 'Hostname: ' . pg_host($db) . "
";
echo 'Port: ' . pg_port($db) . "
";
echo '
insert
';
if (isset($_POST['submit']))
{
if (isset($_POST['a']) and isset($_POST['b']))
$eredmeny = pg_query($db, "insert into y values('".$_POST["a"]."','".$_POST["b"]."')");
if (!$eredmeny)
{
echo "insert hibás!
";goto vege;
} else
{
echo "insert sikerult
";
}
}
$kerdes='select * from y';
$eredmeny=pg_query($db,$kerdes);
if (!$eredmeny) {print 'hibas lekerdezes.';echo pg_last_error($db).'
';echo pg_errormessage($db).'
';goto vege;}
$sor=pg_num_rows($eredmeny);
$oszlop=pg_num_fields($eredmeny);
echo "Sorok szama: " .$sor . "
";
echo "Oszlopok szama: " . $oszlop . "
";
print '';
for ($i=0;$i<$oszlop;$i++) {
print ''.pg_field_name($eredmeny,$i).' | ';
}
for ($i = 0; $i < $sor; $i++) {
print '';
for ($j = 0; $j < $oszlop; $j++) {
print ''.pg_fetch_result($eredmeny, $i, $j).' | ';
}
echo '
';
}
print '';
vege:
pg_close($db);
?>