fork download
  1. <?php
  2. include_once('init.php');
  3.  
  4. $link = mysqli_connect($db['host'], $db['user'], $db['pass'], $db['name']);
  5. $query = "SELECT posts.post_id, posts.user_id, users.user_login, posts.post_text, posts.post_time, posts.is_deleted
  6. FROM posts JOIN users on users.user_id = posts.user_id ORDER BY post_id";
  7.  
  8. $queryResult = mysqli_query($link, $query) or die (mysqli_error($link));
  9. //var_dump($queryResult);
  10.  
  11. $posts = mysqli_fetch_all($queryResult, MYSQLI_ASSOC);
  12.  
  13. if (isset($_SESSION['user_login'])) {
  14. $userName = $_SESSION['user_login'];
  15. $userId = $_SESSION['user_id'];
  16. }
  17.  
  18. include ('view.php');
  19. ?>
Runtime error #stdin #stdout #stderr 0.02s 24400KB
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/tfsJrW/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/tfsJrW/prog.php on line 2
PHP Fatal error:  Call to undefined function mysqli_connect() in /home/tfsJrW/prog.php on line 4