Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //function showproducts($truckId, $maxLoad, $pRoduct){
- //include("index.php");
- $database = "testtask";
- $serverHost = "localhost";
- $serverUsername = "root";
- $serverPassword = "";
- $html = "";
- $mysqli = new mysqli($serverHost, $serverUsername, $serverPassword, $database);
- $stmt = $mysqli->prepare("SELECT productnames.product_name, products.product_id, products.weight FROM products INNER JOIN productnames ON productnames.product_name=? AND products.weight<=?");
- echo $mysqli->error;
- echo "test";
- $stmt->bind_param("si", $product, $maxLoad);
- $stmt->execute();
- echo $stmt->error;
- echo "test2";
- foreach ($stmt as $product {
- echo "test3";
- $html = "<p>" . $product['product_name'] . " " . $product['product_id'] . " " . $product['weight'] . "</p> \n";
- }
- $productList = $html;
- $stmt->close();
- $mysqli->close();
- return $html;
- //}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement