Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <table class=" table-responsive table table-striped table-bordered table-hover ">
  2. <thead>
  3. <tr>
  4. <th>Item #</th>
  5. <th>Description</th>
  6. <th>Unit</th>
  7. <th>Quantity</th>
  8. </tr>
  9. </thead>
  10.  
  11. <?php
  12. $servername = "localhost";
  13. $username = "root";
  14. $password = "";
  15. $dbName = "db";
  16. $port = "3306";
  17.  
  18. $conn = new mysqli($servername, $username, $password, $dbName, $port);
  19.  
  20. if($conn->connect_error)
  21. {
  22. die("Connection Failed: ".$conn->connect_error);
  23. }
  24.  
  25. $sql = "SELECT * FROM product";
  26. $result1 = $conn->query($sql);
  27. $result2 = $conn->query($sql);
  28.  
  29. ?>
  30. <tbody>
  31.  
  32. <?php
  33.  
  34. while ($row = mysqli_fetch_array($result1)) {
  35.  
  36. echo "
  37. <tr>
  38. <td>" . $row[0] . "</td>
  39. <td>" . $row[1] . "</td>
  40. <td>" . $row[2] . "</td>
  41. <td>0</td>
  42.  
  43. </tr>";
  44. }
  45.  
  46. ?>
  47. </tbody>
  48.  
  49. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement