Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. //function showproducts($truckId, $maxLoad, $pRoduct){
  3. //include("index.php");
  4. $database = "testtask";
  5. $serverHost = "localhost";
  6. $serverUsername = "root";
  7. $serverPassword = "";
  8. $html = "";
  9. $mysqli = new mysqli($serverHost, $serverUsername, $serverPassword, $database);
  10. $stmt = $mysqli->prepare("SELECT productnames.product_name, products.product_id, products.weight FROM products INNER JOIN productnames ON productnames.product_name=? AND products.weight<=?");
  11. echo $mysqli->error;
  12. echo "test";
  13. $stmt->bind_param("si", $product, $maxLoad);
  14. $stmt->execute();
  15. echo $stmt->error;
  16. echo "test2";
  17. foreach ($stmt as $product {
  18. echo "test3";
  19. $html = "<p>" . $product['product_name'] . " " . $product['product_id'] . " " . $product['weight'] . "</p> \n";
  20. }
  21. $productList = $html;
  22. $stmt->close();
  23. $mysqli->close();
  24.  
  25. return $html;
  26.  
  27. //}
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement