![]() |
Accessing $db object from within a sidebar block
Hello,
I'm trying to create my first sidebar block using PHP. I'm hitting an issue where I can't access the $db object from within the code. I've tried both $db and $vbulletin->db here's a sample of my code: PHP Code:
Fatal error: Call to a member function query_read() on a non-object in /home/content/04/7100404/html/includes/block/html.php(95) : eval()'d code on line 5 Any ideas? |
That code is called from inside a function, so you need to declare any globals you want to use. You want to add:
Code:
global $vbulletin; |
Quote:
|
All times are GMT. The time now is 11:00 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:
|