Advertisement
dbcalmada

dogbreeds_php

Jan 23rd, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. <?php
  2. include_once "../includes/db.php";
  3.  
  4. $sql = "SELECT * FROM dogbreeds ORDER BY dogbreed";
  5. $result = mysqli_query($_SESSION['dblink'],$sql);
  6.  
  7.  
  8. ?>
  9. <p><a href="dogbreed_form.php">Add Dog Breed</a></p>
  10.  
  11. <table class='datatable'>
  12.     <caption>Dog Breeds</caption>
  13.     <tr>
  14.         <th>Dog Breed</th>
  15.         <th>Description</th>
  16.         <th>Country</th>
  17.         <th>Price</th>
  18.         <th>Discount Rate</th>
  19.         <th>Manage</th>
  20.     </tr>
  21.     <?php
  22.     while ($record = mysqli_fetch_assoc($result)) {
  23.         ?>
  24.         <tr>
  25.             <td><?php print $record['dogbreed'];?></td>
  26.             <td><?php print $record['description'];?></td>
  27.             <td><?php print $record['country_code'];?></td>
  28.             <td><?php print $record['price'];?></td>
  29.             <td><?php print $record['discount_rate'];?></td>
  30.             <td><a href="edit_dogbreed.php?dogbreed=<?php echo $record['dogbreed'];?>">Edit</a>&nbsp;&nbsp;<a href="delete_dogbreed.php?dogbreed=<?php echo $record['dogbreed'];?>">Del</a></td>
  31.         </tr>
  32.         <?php
  33.     }
  34.     ?>
  35. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement