vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   fatal error help (https://vborg.vbsupport.ru/showthread.php?t=240144)

killa seven 04-10-2010 04:00 AM

fatal error help
 
sory for bothering you all again but

this is the error i get

Fatal error: Call to a member function query_read() on a non-objec

and this is the code i used

i am adding this as a plugin under the postbit_display_complete hook

PHP Code:

$results $vbulletin->db->query_read("SELECT username,beat,cscore,oscore FROM" TABLE_PREFIX ." dbh_victims WHERE username = '" .$post[username]. "' ORDER BY beat ASC"); 

this is weird because i had it working using the exact same code and hook...

Lynne 04-10-2010 02:44 PM

You'd be better off doing a join to the $posts, I would think - one less query per post. But anyway, I think you just need to make $vbulletin global first:

PHP Code:

global $vbulletin


killa seven 04-10-2010 03:15 PM

i thought $post only worked for the custom fields like age, post, location ect,,

it would of been much easier if i can use $post for the table i set up in the database

that got rid of the query_read error but fetch array is still a problem

Fatal error: Call to a member function fetch_array() on a non-object in C:\xampp\htdocs\forums\includes\class_postbit.php( 294) : eval()'d code on line 6

Lynne 04-10-2010 04:17 PM

Try hooking into the query for the $post. That is what I'm talking about.

As for your other error, I have no idea why you get it since you never posted the full code to your plugin.

killa seven 04-10-2010 04:22 PM

im leaning towards hooking into the $post query but heres the code i used

PHP Code:

global $vbulletin;

$vics $vbulletin->db->query_read("SELECT username,beat,cscore,oscore FROM" TABLE_PREFIX ." dbh_victims WHERE username = '" .$post[username]. "' ORDER BY beat ASC");


while (
$get $db->fetch_array($vics))
{
eval(
'$vicbits .= "' fetch_template('dbh_victim_bits') . '";');



--------------- Added [DATE]1270920477[/DATE] at [TIME]1270920477[/TIME] ---------------

stupid me.. got it to work with $vbulletin->db->fetch_array

thanks for your help


All times are GMT. The time now is 09:05 PM.

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.01081 seconds
  • Memory Usage 1,721KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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