Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "Bat";
- $password = "IamTheBat";
- $database = "SpecsCompare";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $database);
- // Check connection
- if ($conn->mysqli_connect_error) {
- die("Connection failed: " . $conn->mysqli_connect_error);
- }
- echo "Connected successfully";
- $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";
- $result = mysqli_query($conn, $query_test);
- $rows = mysqli_fetch_all($result, MYSQLI_BOTH);
- $name = $row['itemname'];
- $price = $row['price'];
- $category = $row['categoryname'];
- $shop = $row['shopname'];
- $manufacturer = = $row['manufacturername'];
- $module = $row['modulename'];
- $type = $row['typename'];
- /*while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
- echo "<br>";
- echo $row['itemname'];
- }*/
- ?>
- <section class="list">
- <div id="galaxyTable">
- <table class="table table-hover table-condensed">
- <thead>
- <tr>
- <td>Name</td>
- <td>Price</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td></td>
- <td></td>
- <td><a href="#" class="button">Details</a></td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- <div id="galaxydetailedTable" class="hidden">
- <table class="table table-hover table-condensed">
- <thead>
- <tr>
- <td>Name</td>
- <td>Category</td>
- <td>Price</td>
- <td>Shop</td>
- <td>Manufacturer</td>
- <td>Module</td>
- <td>Type</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><?php echo $name ?></td>
- <td><?php echo $category ?></td>
- <td><?php echo $price ?></td>
- <td><?php echo $shop ?></td>
- <td><?php echo $manufacturer ?></td>
- <td><?php echo $module ?></td>
- <td><?php echo $type ?></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </section>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement