vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=322083

Custom query in PHP module
by robertw795
11 Mar 2016 10:27

I've been trying to query some data from a custom table in my vBulletin database from a PHP module added to a new page.

I have tried using the syntax that I found on this link; https://www.vbulletin.com/docs/html/...ards_sql_query

I try to store the results in a variable, after that I check if the variable actually has contents using an if condition. If so, it has to echo the contents to my module.

All of this should work theoratically, but as soon as I save the page and load it it only shows the page background. When inspecting the page I saw that the complete body is empty.

What am I doing wrong here?

Thanks in advance

Replicant 11 Mar 2016 13:23

A blank page is usually the result of a syntax error in the php. A missing semi-colon can cause it. Did you use open and closing php tags? try removing those.

--------------- Added 11 Mar 2016 at 14:08 ---------------

After re-reading your post and looking at the link you provided, I realized you're going about it the vb3/4 way. VB5 is totally different. Your best bet is to create a product and write your class to query the database, initial checks and return the results. Then call your api from the template code and use your if conditions there.

Checkout the vB_dB_Assertor Class Reference docs.


All times are GMT. The time now is 10:53.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.