Advertisement
Guest User

Untitled

a guest
Aug 11th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "Bat";
  4. $password = "IamTheBat";
  5. $database = "SpecsCompare";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $database);
  9.  
  10. // Check connection
  11. if ($conn->mysqli_connect_error) {
  12. die("Connection failed: " . $conn->mysqli_connect_error);
  13. }
  14. echo "Connected successfully";
  15.  
  16. $query_test = "SELECT * FROM prices p, items i, shops s, categories c WHERE p.shopid=s.shopid AND i.categoryid=c.categoryid AND p.itemid=i.itemid AND i.categoryid=1004 AND s.shopid=5005";
  17. $result = mysqli_query($conn, $query_test);
  18. $rows = mysqli_fetch_all($result, MYSQLI_BOTH);
  19. $name = $row['itemname'];
  20. $price = $row['price'];
  21. $category = $row['categoryname'];
  22. $shop = $row['shopname'];
  23. $manufacturer = = $row['manufacturername'];
  24. $module = $row['modulename'];
  25. $type = $row['typename'];
  26. /*while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
  27. echo "<br>";
  28. echo $row['itemname'];
  29. }*/
  30. ?>
  31.  
  32. <section class="list">
  33. <div id="galaxyTable">
  34. <table class="table table-hover table-condensed">
  35. <thead>
  36. <tr>
  37. <td>Name</td>
  38. <td>Price</td>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr>
  43. <td></td>
  44. <td></td>
  45. <td><a href="#" class="button">Details</a></td>
  46. </tr>
  47. <?php } ?>
  48. </tbody>
  49. </table>
  50. <div id="galaxydetailedTable" class="hidden">
  51. <table class="table table-hover table-condensed">
  52. <thead>
  53. <tr>
  54. <td>Name</td>
  55. <td>Category</td>
  56. <td>Price</td>
  57. <td>Shop</td>
  58. <td>Manufacturer</td>
  59. <td>Module</td>
  60. <td>Type</td>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <tr>
  65. <td><?php echo $name ?></td>
  66. <td><?php echo $category ?></td>
  67. <td><?php echo $price ?></td>
  68. <td><?php echo $shop ?></td>
  69. <td><?php echo $manufacturer ?></td>
  70. <td><?php echo $module ?></td>
  71. <td><?php echo $type ?></td>
  72. </tr>
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. </section>
  78.  
  79.  
  80.  
  81. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement