Guest User

Untitled

a guest
Apr 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2.         $conn = pg_connect("host=db.dcs.aber.ac.uk port=5432 dbname=teaching user=csguest password=*");
  3.         $db = pg_query ($conn, "select * from CSGames ORDER BY refnumber");
  4.         echo "<table border='1'>";
  5.         echo "<td>Order?</td> <td>Games</td> <td>Platform</td> <td>Description</td> <td>Price</td>";
  6.         if (!$conn)
  7.             {
  8.                 die('Error connecting to Database: ' . pg_error());
  9.             }
  10.             while ($a = pg_fetch_array ($db))
  11.                 {
  12.                 echo "<tr>";
  13.                 echo "<td><input type='checkbox' name="select[$a['refnumber']]"</td>";
  14.                 echo "<td>" . $a["title"] . "</td>";
  15.                 echo "<td>" . $a["platform"] . "</td>";
  16.                 echo "<td>" . $a["description"] . "</td>";
  17.                 echo "<td>£" . $a["price"] . "</td>";
  18.                 echo "</tr>";
  19.             }
  20.         echo "</table>\n";
  21.     ?>
Add Comment
Please, Sign In to add comment