Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('DB_SERVER', 'labdb');
- define('DB_USERNAME', 'scott');
- define('DB_PASSWORD', 'tiger');
- define('DB_DATABASE', 'bd');
- $db = pg_connect("host=".DB_SERVER." dbname=".DB_DATABASE." user=".DB_USERNAME." password=".DB_PASSWORD)
- or die('Could not connect: ' . pg_last_error());
- //$output = $_POST['username'] . " " . $_POST['password'];
- // echo "<script>console.log( 'Config PHP: " . $db . "' );</script>\r\n";
- // if (!pg_connection_busy($db)) {
- // echo "<script>console.log( 'Sending query' );</script>\r\n";
- // $result = pg_query($db, "SELECT * FROM pk394397.konto");
- // }
- // $wiersze1 = pg_num_rows($result);
- // $output = ((string)$wiersze1)."rekordy(ow)";
- // echo "<script>console.log( 'QUERY PHP: " . $output . "' );</script>\r\n";
- // $i = 0;
- // echo "<table><tr>";
- // while ($i < pg_num_fields($result))
- // {
- // $fieldname = pg_field_name($result, $i);
- // echo "<td>" . $fieldname . "</td>";
- // $i = $i + 1;
- // }
- // echo "</tr>";
- // $i = 0;
- // while ($row = pg_fetch_row($result))
- // {
- // echo "<tr>";
- // $count = count($row);
- // $y = 0;
- // while ($y < $count)
- // {
- // $c_row = current($row);
- // echo "<td>" . $c_row . "</td>";
- // next($row);
- // $y = $y + 1;
- // }
- // echo "</tr>";
- // $i = $i + 1;
- // }
- // pg_free_result($result);
- // echo "</table>\r\n";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement