SHARE
TWEET

Untitled

a guest Jan 3rd, 2017 444 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   <html>
  3.  
  4.   <head>
  5.    <title>Test</title>
  6.   </head>
  7.  
  8.   <body bgcolor="white">
  9.  
  10.   <?php
  11.    $link = pg_Connect("host=***.***.***.** dbname=****** user=***** password=*****");
  12.   $result = pg_exec($link, "select * from res_partner");
  13.   $numrows = pg_numrows($result);
  14.   echo "<p>link = $link<br>
  15.   result = $result<br>
  16.   numrows = $numrows</p>
  17.   ";
  18.   ?>
  19.  
  20.   <table border="1">
  21.   <tr>
  22.    <th>name</th>
  23.    <th>First name</th>
  24.    <th>ID</th>
  25.   </tr>
  26.   <?php
  27.  
  28.    // Loop on rows in the result set.
  29.  
  30.    for($ri = 0; $ri < $numrows; $ri++) {
  31.     echo "<tr>\n";
  32.     $row = pg_fetch_array($result, $ri);
  33.     echo " <td>", $row["name"], "</td>
  34.    <td>", $row["city"], "</td>
  35.    <td>", $row["x_meb"], "</td>
  36.   </tr>
  37.   ";
  38.    }
  39.    pg_close($link);
  40.   ?>
  41.   </table>
  42.  
  43.   </body>
  44.  
  45.   </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top