Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. $con = mysqli_connect('csmysql.cs.cf.ac.uk','username',"password", "folder the table is in ");
  3. $sql="SELECT * FROM OnlineShop";
  4.  
  5. $records=mysqli_query($con, $sql);
  6. ?>
  7.  
  8. <html>
  9.  
  10. <head>
  11. <link rel="stylesheet" type="text/css" href="style.css" >
  12. <title> Trial Store </title>
  13. </head>
  14.  
  15. <body>
  16.  
  17. <table width= "600" border ="1px" cellpaddin="1px" cellspacing ="1px">
  18. <tr>
  19.  
  20. <th>ID</th>
  21. <th>Name</th>
  22. <th>Description</th>
  23. <th>Price</th>
  24. <th>Picture</th>
  25. <tr>
  26. <?php
  27. while($OnlineShop=mysqli_fetch_assoc($records)){
  28. echo "<tr>";
  29.  
  30. echo "<td>".$OnlineShop['id']."</td>";
  31.  
  32. echo "<td>".$OnlineShop['name']."</td>";
  33.  
  34. echo "<td>".$OnlineShop['description']."</td>";
  35.  
  36. echo "<td>".$OnlineShop['price']."</td>";
  37.  
  38. echo "<td><img src = ".$OnlineShop['picture']."></td>";
  39.  
  40. echo "</tr>";
  41. }
  42. ?>
  43.  
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement