The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
PHP Widget and Database
Hi,
I'm looking at the new PHP widget and trying to work out how to use it and if it's possible. I'm wanting to connect to a database and then display rows from the database but I'm a little confused on how to use the $output part. Can anyone enlighten me? Here's a very rough of the idea PHP Code:
|
#2
|
|||
|
|||
Instead of echo use a template or put it into the $output variable!
You could also work with the ouput buffer. PHP Code:
|
#3
|
||||
|
||||
Yeah I switched to output after reading a few threads but now getting this error message
Fatal error: Call to a member function fetch_array() on a non-object in /home/iycstaff/public_html/packages/vbcms/widget/execphp.php(171) : eval()'d code on line 17 Any ideas what's going wrong? |
#4
|
|||
|
|||
use vB::$db-> instead of $db
|
#5
|
||||
|
||||
hmm throwing this up
Parse error: syntax error, unexpected ':' in /home/iycstaff/public_html/packages/vbcms/widget/execphp.php(171) : eval()'d code on line 19 |
#6
|
|||
|
|||
Sorry it should be vB::$db
|
#7
|
||||
|
||||
That worked a peach, cheers. I wonder if I can pull anything from another database rather than the vbulletin one?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|