![]() |
Call to a member function query_read() on a non-object
I seem to run into this problem a lot and it's always a pain to fix. This is being used to make a bbcode with this mod: https://vborg.vbsupport.ru/showthrea...44#post2346244 .
PHP Code:
I added the require_once on global to try and fix it but it didn't work. Every time I have this problem I always find this as well: https://vborg.vbsupport.ru/showthread.php?t=235092 but that never fixed it either. Changing the query to vB::$db->query_read(" simply changes the error saying that the class vB isn't defined. also using $vbulletin->db->query_read doesn't seem to solve the problem either. |
Below this code
Code:
require_once('./global.php'); Code:
global $db; |
I prefer to have $vbulletin global and use $vbulletin->db.
|
Quote:
Code:
or you change $db-> with $vbulletin->db Quote:
Code:
$db->fetch_array |
Thanks guys.
--------------- Added [DATE]1341819639[/DATE] at [TIME]1341819639[/TIME] --------------- Quote:
|
Are you using this within a hook? If so, you should remove that require because global.php has already been included.
|
Quote:
Code:
$GLOBALS['vbulletin']->db |
All times are GMT. The time now is 06:52 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|