Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect('csmysql.cs.cf.ac.uk','username',"password", "folder the table is in ");
- $sql="SELECT * FROM OnlineShop";
- $records=mysqli_query($con, $sql);
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="style.css" >
- <title> Trial Store </title>
- </head>
- <body>
- <table width= "600" border ="1px" cellpaddin="1px" cellspacing ="1px">
- <tr>
- <th>ID</th>
- <th>Name</th>
- <th>Description</th>
- <th>Price</th>
- <th>Picture</th>
- <tr>
- <?php
- while($OnlineShop=mysqli_fetch_assoc($records)){
- echo "<tr>";
- echo "<td>".$OnlineShop['id']."</td>";
- echo "<td>".$OnlineShop['name']."</td>";
- echo "<td>".$OnlineShop['description']."</td>";
- echo "<td>".$OnlineShop['price']."</td>";
- echo "<td><img src = ".$OnlineShop['picture']."></td>";
- echo "</tr>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement