Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. //make connection
  5. $con = mysqli_connect('csmysql.cs.cf.ac.uk', 'c1414295', 'enyiz5', 'items');
  6.  
  7.  
  8.  
  9. $sql = "SElECT * FROM items";
  10.  
  11. $records = mysqli_query($con, $sql);
  12.  
  13.  
  14.  
  15.  
  16. ?>
  17. <html>
  18.  
  19.  
  20.  
  21. <head>
  22. <title>title</title>
  23. </head>
  24.  
  25.  
  26.  
  27.  
  28. <body>
  29. <table width="600" border="1" cellpadding="1" cellspacing="1">
  30.  
  31. <tr>
  32. <th>ID</th>
  33. <th>Name</th>
  34. <th>Price</th>
  35. <th>Description</th>
  36. <th>Picture</th>
  37. </tr>
  38.  
  39. <?php
  40. while($items=mysqli_fetch_assoc($records)){
  41.  
  42. echo "<tr>";
  43.  
  44. echo "<td>".$items['ID']."</td>";
  45. echo "<td>".$items['Name']."</td>";
  46. echo "<td>".$items['Price']."</td>";
  47. echo "<td>".$items['Description']."</td>";
  48. echo "<td>".$items['Picture']."</td>";
  49.  
  50. echo "</tr>";
  51.  
  52.  
  53. }//end while
  54. ?>
  55.  
  56.  
  57. </table>
  58. </body>
  59.  
  60.  
  61.  
  62.  
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement