vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Using the vBulletin Database Class (https://vborg.vbsupport.ru/showthread.php?t=119350)

Paul M 12-07-2006 03:55 AM

$vbulletin->db->num_rows($resourceid);

Billspaintball 01-22-2007 04:03 AM

Oh yeah!
More of the puzzel becomes clear.
Thanks Alan :D

Jelmertjee 03-12-2007 05:55 PM

great article, this is certainly very useful for anyone trying to customize Vbulletin or making an entire mod, thanks!

Blue182 07-02-2007 01:12 PM

Nice article!

I wrote a function which uses the $vbulletin->db object. But I always get
Quote:

Fatal error: Call to a member function on a non-object in ...

I also included the global.php using require_once('./global.php');
But why I can't use the object inside a function?

Guest190829 07-02-2007 01:23 PM

Edit: Sorry, thought this was the datamanager class...

Where are you using this? And what is the code you are using?

Blue182 07-02-2007 01:38 PM

I'm working on a custom page.
I followed this tutorial and everything is working fine. I can also use the $vbulletin->db object on the custom page. But if I try to use it inside a function, it just throws Fatal error: Call to a member function on a non-object in....

This is the code:
PHP Code:

[...]
// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 

[...]
// ######################## START MAIN SCRIPT ############################ 
$content[center] = do_something(3);
[...]
// ######################## FUNCTIONS ############################ 
function do_something($value) {
    
    [...]
    
$result $vbulletin->db->query_read($sql);

    while (
$array $vbulletin->db->fetch_array($result))
    {
        [...]
    } 
    return 
$output;



Guest190829 07-02-2007 01:40 PM

put the statement:

PHP Code:

global $vbulletin

right after

PHP Code:

function do_something($value) { 

This will give the $vbulletin object scope within the function...

Blue182 07-02-2007 01:43 PM

Quote:

Originally Posted by Danny.VBT (Post 1281248)
put the statement:

PHP Code:

global $vbulletin

right after

PHP Code:

function do_something($value) { 

This will give the $vbulletin object scope within the function...

Ah, thank you very much :)

Panman 08-26-2007 12:09 AM

What is the method to use if you'd like to execute a DELETE SQL statement?

amnesia623 09-03-2007 06:25 PM

Thank You!

Great stuff...


All times are GMT. The time now is 12:59 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01220 seconds
  • Memory Usage 1,741KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete