fork download
  1. SCRIPT I RUN FROM LINK
  2.  
  3. <?php
  4. require_once 'include/DB_Functions.php';
  5. $db = new DB_Functions();
  6.  
  7. // Receiving The Post Params
  8. $user_unique_id = $_POST['user_unique_id'];
  9. $offset = $_POST['offset'];
  10.  
  11. $converted_offset = intval($offset);
  12. //echo $user_unique_id . "<br />";
  13. //echo $offset . "<br />";
  14. //echo $converted_offset . "<br />";
  15. // Getting Result Array
  16. $resultArray = $db->getUserFavouriteRecipes($user_unique_id, $converted_offset);
  17. echo json_encode($resultArray);
  18. ?>
  19.  
  20. FUNCTION IN CLASS DB_FUNCTIONS
  21. public function getUserFavouriteRecipes($user_unique_id, $offset) {
  22. //echo $user_unique_id . "<br />";
  23. //echo $offset;
  24. $stmt = $this->conn->prepare("SELECT recipe.`unique_id`, recipe.`title`, recipe.`img_tumbnail_link`, recipe.`add_date`, recipe.`kitchen_type`, recipe.`meal_type`, user.`name`, user.`surname`,
  25. (SELECT count(*) from `like` WHERE recipe.`unique_id` = `like`.`recipe_unique_id_fk`) AS like_count
  26. FROM `recipe`
  27. JOIN `favourite` ON (recipe.`unique_id` = `favourite`.`recipe_unique_id_fk`)
  28. JOIN `user` ON (recipe.`user_unique_id_fk` = user.`unique_id`)
  29. WHERE favourite.`user_unique_id_fk` = ?
  30. ORDER BY recipe.`unique_id` DESC
  31. LIMIT ?, 10");
  32.  
  33. $stmt->bind_param("si", $user_unique_id, $converted_limit);
  34. $result = $stmt->execute();
  35.  
  36. $myArray = array();
  37.  
  38. if($result) {
  39. $result_set = $stmt->get_result();
  40.  
  41. while($row = $result_set->fetch_assoc()) {
  42. $myArray[] = $row;
  43. }
  44.  
  45. return $myArray;
  46. } else {
  47. return NULL;
  48. }
  49. }
Runtime error #stdin #stdout #stderr 0.02s 52480KB
stdin
Standard input is empty
stdout
SCRIPT I RUN FROM LINK

stderr
PHP Warning:  require_once(include/DB_Functions.php): failed to open stream: No such file or directory in /home/uLo0ps/prog.php on line 4
PHP Fatal error:  require_once(): Failed opening required 'include/DB_Functions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/uLo0ps/prog.php on line 4