Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>PostgreSQL SELECT Example 1</title>
- <meta name="description" content="If we want to fetch all rows from the actor table the following PostgreSQL SELECT statement can be used.">
- </head>
- <body>
- <h1>List of all actors in the table</h1>
- <?php
- $host = "104.198.145.144";
- $port = "5432";
- $dbname = "PWDDB";
- $user = "postgres";
- $password = "pwd";
- $conn = pg_connect("host=$host port=$port dbname=$dbname user=$user password=$password");
- $result = pg_query($conn,"select gid, objectid, unternehme, linien, akt-date from "buslinien" limit 19;");
- echo "<table>";
- while($row=pg_fetch_assoc($result)){echo "<tr>";
- echo "<td align='center' width='200'>" . $row['gid'] . "</td>";
- echo "<td align='center' width='200'>" . $row['objectid'] . "</td>";
- echo "<td align='center' width='200'>" . $row['unternehme'] . "</td>";
- echo "<td align='center' width='200'>" . $row['akt-date'] . "</td>";
- echo "</tr>";}echo "</table>";?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement