Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.51 KB | None | 0 0
  1. <?php
  2.     define('DB_SERVER', 'labdb');
  3.     define('DB_USERNAME', 'scott');
  4.     define('DB_PASSWORD', 'tiger');
  5.     define('DB_DATABASE', 'bd');
  6.     $db = pg_connect("host=".DB_SERVER." dbname=".DB_DATABASE." user=".DB_USERNAME." password=".DB_PASSWORD)
  7.        or die('Could not connect: ' . pg_last_error());
  8.  
  9.    //$output = $_POST['username'] . " " . $_POST['password'];
  10.  
  11.     // echo "<script>console.log( 'Config PHP: " . $db . "' );</script>\r\n";
  12.     // if (!pg_connection_busy($db)) {
  13.     //     echo "<script>console.log( 'Sending query' );</script>\r\n";
  14.     //     $result = pg_query($db, "SELECT * FROM pk394397.konto");
  15.     // }
  16.  
  17.     // $wiersze1 = pg_num_rows($result);
  18.     // $output = ((string)$wiersze1)."rekordy(ow)";
  19.     // echo "<script>console.log( 'QUERY PHP: " . $output . "' );</script>\r\n";
  20.     // $i = 0;
  21.     // echo "<table><tr>";
  22.     // while ($i < pg_num_fields($result))
  23.    // {
  24.    //    $fieldname = pg_field_name($result, $i);
  25.    //    echo "<td>" . $fieldname . "</td>";
  26.     //    $i = $i + 1;
  27.     // }
  28.     // echo "</tr>";
  29.     // $i = 0;
  30.  
  31.     // while ($row = pg_fetch_row($result))
  32.     // {
  33.     //    echo "<tr>";
  34.     //    $count = count($row);
  35.     //    $y = 0;
  36.     //    while ($y < $count)
  37.    //    {
  38.    //        $c_row = current($row);
  39.    //        echo "<td>" . $c_row . "</td>";
  40.     //        next($row);
  41.     //        $y = $y + 1;
  42.     //    }
  43.     //    echo "</tr>";
  44.     //    $i = $i + 1;
  45.     // }
  46.     // pg_free_result($result);
  47.  
  48.     // echo "</table>\r\n";
  49.  
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement