Guest User

Untitled

a guest
Apr 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. <?php $conn = pg_connect("host=db.dcs.aber.ac.uk port=5432 dbname=teaching user=csguest password=rohishe"); ?>
  2. // HINT- switch case to ADD and REMOVE the ID (gets the action)
  3. // add some statement for your query to work;
  4.  
  5.  
  6.     $res = pg_query ($conn, "SELECT refnumber, title, platform, description, price FROM CSGames  WHERE refnumber= $id ORDER BY title");
  7.            
  8.  
  9.             $a = pg_fetch_array($res);
  10.  
  11.             echo "<tr>";
  12.             echo "<td class='title'><h3>" . $a['title'] . "</h3><p>". $a['platform'] ."</p></td>";
  13.        
  14.             echo "<td class='description'>" . $a['description'] . "</td>";
  15.             echo "<td class='price'>&pound;" . $a['price'] . "</td>";
  16.             echo "<td class='quantity'>" . $quantity . "</td>";
  17.             echo "</tr>";
  18.            
  19.             echo "<td><a class='buttons' href='gameshop.php?action=add&id=" . $a['refnumber'] . "'>Add Quantity</td>";
  20.             echo "<td><a class='buttons' href='gameshop.php?action=remove&id=" . $a['refnumber'] . "'>Remove Quantity</a></td>";
Add Comment
Please, Sign In to add comment