show.php 498 Bytes
Newer Older
David Morley's avatar
David Morley committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?php
 include('config.php');
 $dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
 if (!$dbh) {
     die("Error in connection: " . pg_last_error());
 }  
 $sql = "SELECT * FROM pods";
 $result = pg_query($dbh, $sql);
 if (!$result) {
     die("Error in SQL query: " . pg_last_error());
 }   
 while ($row = pg_fetch_array($result)) {
     echo "pod" . $row[1] . "<br />";
     echo "pingdom: " . $row[2] . "<p />";
 }   





 pg_free_result($result);       
 pg_close($dbh);






?>