The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Cannot access empty property
Fatal error: Cannot access empty property in ...
What does this error mean? I have the following code in one of my functions... Code:
global $vbulletin; $query = ("SELECT * FROM rank_players ORDER BY $sort $order, pName ASC"); $result = $vbulletin->$db->query_read($query); while ($player = $vbulletin->$db->fetch_array($result)) {...} The table rank_players IS empty, but it should instead simply fail the while loop on line 7; but it never makes it that far and instead dies right on line 5. Also, what is the difference between $vbulletin->$db-> and $db-> ? Is there a reason to use one over the other? |
#2
|
||||
|
||||
I think that $vbulletin is the name of the main class that handels all or most of the queries I havent seen any mods that donet have $vbulletin->$db->. You might look to see if theres a class just called $db and if so see all of its methods and operatiosn to make sure they do what you wont them to.
|
#3
|
|||
|
|||
Well I just changed my above code to the following, and now it works...
Code:
global $db; $query = ("SELECT * FROM rank_players ORDER BY $sort $order, pName ASC"); $result = $db->query_read($query); while ($player = $db->fetch_array($result)) {...} |
#4
|
||||
|
||||
It depends on what your trying to do to understand more you would need to look at the classes themselves to see what each one is capable of doing. Its the same in desktop programming if you make a call to a class but it doesnt support the fuctionality your looking for it will more then likely not work unless you make a if condition to test if it supports what your trying to do. vbulletin is the main class and I'm sure db is made to handel the lesser query tasks.
|
#5
|
||||
|
||||
You will see this in one of the files:
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|