fork download
  1. <?php
  2. $printarea;
  3. require_once "connectdb.php";
  4.  
  5. $myArrays = array(
  6. "РТ-00002266" => "6",
  7. "РТ-00003236" => "2",
  8. "РТ-00002193" => "4"
  9. );
  10.  
  11.  
  12. if ($stmt = $mysqli->query("SELECT * FROM pricelist ORDER BY art" )) {
  13. foreach ($myArrays as $key => $value) {
  14. $idArray = $key;
  15. $countArray = (int)$value;
  16.  
  17. $printarea .= $idArray . " " . $countArray . "</br>";
  18.  
  19. while($row = $stmt->fetch_assoc()){
  20. $id = $row['id'];
  21. $name = $row['name'];
  22. $price = $row['price'];
  23. if (strcasecmp($id, $idArray) == 0) {
  24. for ($i = 0; $i < $countArray; $i++) {
  25. $printarea .= "match" . "</br>";
  26. }
  27. }
  28. }
  29. }
  30. }
  31.  
  32. echo $printarea;
  33.  
Runtime error #stdin #stdout #stderr 0.02s 52480KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  require_once(connectdb.php): failed to open stream: No such file or directory in /home/Utmeo1/prog.php on line 3
PHP Fatal error:  require_once(): Failed opening required 'connectdb.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/Utmeo1/prog.php on line 3