Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $servername = 'localhost';
- $username = DB_USERNAME;
- $password = DB_PASSWORD;
- $database = DB_DATABASE;
- // Create connection
- $conn = new mysqli($servername, $username, $password, $database);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT * FROM product,product_description,product_to_category WHERE product.product_id = product_description.product_id AND product.product_id = product_to_category.product_id AND product_description.language_id = 2 AND model IN(5525,5859,5367,5174,5411,5814,5788,5221,5948,5989,5953,5667)";
- $conn->set_charset('utf8mb4');
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($product = $result->fetch_assoc()) {
- $name = $product['name'];
- $price = number_format((float)$product['price'], 2, '.', '') . " ะปะฒ.";
- $image = "https://example.com/image/" . $product['image'];
- $link = "https://example.com/index.php?route=product/product&product_id=" . $product['product_id'];
- echo $name . "<br>";
- echo $price . "<br>";
- echo $image . "<br>";
- ?>
- <a href="<?php echo $link ?>" title=""><?php echo $link ?></a> <br>
- <?php
- echo "________________________<br>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement