Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $bdcon = pg_connect("host=200.137.66.7 port=5432 dbname=bocadb user=postgres password=123456") or die('connection failed: '. pg_last_error());
- $query = 'SELECT * FROM usertable';
- $result = pg_query($query) or die('Query failed: ' . pg_last_error());
- echo "<table>\n";
- while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
- echo "\t<tr>\n";
- foreach ($line as $col_value) {
- echo "\t\t<td>$col_value</td>\n";
- }
- echo "\t</tr>\n";
- }
- echo "</table>\n";
- pg_free_result($result);
- pg_close($bdcon);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement