Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PostgreSQL SELECT Example 1</title>
  6. <meta name="description" content="If we want to fetch all rows from the actor table the following PostgreSQL SELECT statement can be used.">
  7. </head>
  8. <body>
  9. <h1>List of all actors in the table</h1>
  10. <?php
  11.  
  12. $host = "104.198.145.144";
  13. $port = "5432";
  14. $dbname = "PWDDB";
  15. $user = "postgres";
  16. $password = "pwd";
  17.  
  18. $conn = pg_connect("host=$host port=$port dbname=$dbname user=$user password=$password");
  19.  
  20.  
  21. $result = pg_query($conn,"select gid, objectid, unternehme, linien, akt-date from "buslinien" limit 19;");
  22. echo "<table>";
  23. while($row=pg_fetch_assoc($result)){echo "<tr>";
  24. echo "<td align='center' width='200'>" . $row['gid'] . "</td>";
  25. echo "<td align='center' width='200'>" . $row['objectid'] . "</td>";
  26. echo "<td align='center' width='200'>" . $row['unternehme'] . "</td>";
  27. echo "<td align='center' width='200'>" . $row['akt-date'] . "</td>";
  28. echo "</tr>";}echo "</table>";?>
  29. </div>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement