Advertisement
Guest User

php

a guest
Oct 12th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.    
  3.   $dbconn = pg_connect("host=192.168.0.118 dbname=maslovo user=admin password=111") or die('Could not connect: ' . pg_last_error());
  4.  
  5.  
  6.   $query = "SELECT name FROM layers_shp_class";
  7.   $result = pg_query($query) or die('Fail!' /*. pg_last_error()*/);
  8.      
  9.        // $len = pg_field_prtlen($result, 0);
  10.        // $rows = pg_num_rows($result);
  11.   echo '<div class="tree"><ul>';
  12.   while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {              
  13.         foreach ($line as $col_value) {
  14.             echo "\t\t<li>$col_value</li>\n";
  15.         }
  16.   };
  17.   echo "\t</ul></div>\n";
  18.        
  19.     pg_free_result($result);
  20.     pg_close($dbconn);
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement