Guest User

Untitled

a guest
Apr 17th, 2018
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.  
  2. $conn = pg_connect("host=x.dcs.x.ac.uk port=5432 dbname=teaching user=x password=x");
  3. echo "<table border='1'> <tr><th>ID#</th><th>Title</th><th>Platform</th><th>Description</th><th>Price (&pound;)</th><th>User</th></tr>";
  4. foreach($_SESSION["productSelected"] as $id){
  5. $res = pg_query ($conn, "select * from CSGames WHERE refnumber='$id' order by refnumber");
  6. while ($a = pg_fetch_row($res))
  7. {
  8. echo "<tr>";
  9.  
  10. for ($j = 0; $j < pg_num_fields($res); $j++)
  11. {
  12.  
  13. echo "<td>" . $a[$j] . "</td>";
  14. }
  15. echo "</tr>";
  16. $total += $id['price'];
  17. }
  18. }
  19. echo "</table>";
  20. echo $total;
Add Comment
Please, Sign In to add comment