vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Custom query in PHP module (https://vborg.vbsupport.ru/showthread.php?t=322083)

robertw795 03-11-2016 09:27 AM

Custom query in PHP module
 
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 03-11-2016 12:23 PM

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 [DATE]1457708894[/DATE] at [TIME]1457708894[/TIME] ---------------

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 02:59 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00971 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete