vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need help with "Call to a member function on a non-object" error (https://vborg.vbsupport.ru/showthread.php?t=99449)

JJR512 10-27-2005 05:04 PM

Need help with "Call to a member function on a non-object" error
 
I'm working on a plugin to forumhome_complete.

When I try to load the forum index, I get this error:
Quote:

Fatal error: Call to a member function on a non-object in /home/jjr512/public_html/testbbs/index.php(459) : eval()'d code on line 23
Line 23 of the plugin is this:
Code:

$DB->query("INSERT INTO test (userid, dateline, text) VALUES (1,1130351299,boo)");
Notes:
I've tried using $DB->query_write as well as $DB->query. No difference. I've tried putting single quotes or double quotes around any and all of the values. No difference. (I'm using hard-coded data for now, as you can see; I'll work on getting variables in there later.)

I've looked at INSERT queries in various stock vB files and all seem to be formatted the same way as this, except for how it's written out over multiple lines. I've tried it that way, too, but it made no difference.

What am I doing wrong?

Paul M 10-27-2005 05:06 PM

Change $DB->query to $vbulletin->db->query_write

JJR512 10-27-2005 06:05 PM

OK, that works, thanks.

But I guess I'm still wondering... WHY does it work, when the several other INSERT queries I looked at in stock vBulletin files, as well as the external file from some other hacks, are like what I was originally trying? And why does a $variable = $db->query_read() work just fine in the same plugin (before the INSERT query)?

Paul M 10-27-2005 06:09 PM

No idea, I just always use the full version, then there is no problem.


All times are GMT. The time now is 07:02 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.01058 seconds
  • Memory Usage 1,714KB
  • 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)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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