Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. php fatal error uncaught error using $this when not in object context
  2.  
  3. $r = $this->db->query($query); // * вот на этой строчке
  4.  
  5. $tree = array();
  6.  
  7. while ($category = $this->db->fetchObject($r)) {
  8.  
  9. // .... тут я работаю с категориями,
  10.  
  11. # Execute the query or queries array
  12. public function query($q)
  13. {
  14. if ($this->link) {
  15. $start = microtime(true);
  16. $this->res_id = mysqli_query($this->link,$q);
  17. }
  18. else {
  19. $this->error_msg = "Could not execute query to $this->db_name database, wrong database link";
  20. return 0;
  21. }
  22. if (!$this->res_id && $this->exception_on_error) {
  23. trigger_error("Could not execute query to $this->db_name database, wrong result id", E_USER_ERROR);
  24. return 0;
  25. }
  26. return $this->res_id;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement