fork download
  1. <?php
  2. include_once('init.php');
  3.  
  4. $mysqli = new mysqli($db['host'], $db['user'], $db['pass'], $db['name']);
  5. if ($mysqli->connect_errno) {
  6. echo "Не удалось подключиться к MySQL: " . $mysqli->connect_error;
  7. }
  8.  
  9. $stmt = $mysqli->prepare("SELECT posts.post_id, posts.user_id, users.user_login, posts.post_text, posts.post_time, posts.is_deleted
  10. FROM posts JOIN users on users.user_id = posts.user_id ORDER BY post_id");
  11.  
  12. $stmt->execute();
  13.  
  14. $queryResult = $stmt->get_result();
  15.  
  16. $posts = $queryResult->fetch_all(MYSQLI_ASSOC);
  17.  
  18. if (isset($_SESSION['user_login'])) {
  19. $userName = $_SESSION['user_login'];
  20. $userId = $_SESSION['user_id'];
  21. }
  22.  
  23. include ('view.php');
  24. ?>
Runtime error #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  include_once(init.php): failed to open stream: No such file or directory in /home/43Igcr/prog.php on line 2
PHP Warning:  include_once(): Failed opening 'init.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/43Igcr/prog.php on line 2
PHP Fatal error:  Class 'mysqli' not found in /home/43Igcr/prog.php on line 4