vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Own query in fuction (https://vborg.vbsupport.ru/showthread.php?t=226943)

PanterSi 10-28-2009 07:04 AM

Own query in fuction
 
I have integrated page and want my own query execute in own function. Is there any similar to query_read_slave, because unfortunately this not work to call from function (Fatal error: Call to a member function query_read_slave() on a non-object).

Regards

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

I solve a problem.
Instead of
$thread = $db->query_read_slave($strSQL);
while ($row = $db->fetch_array($thread))
...
I used
$thread = mysql_query($strSQL);
while ($row = mysql_fetch_array($thread))


Any one know what is the main difference?

Lynne 10-28-2009 03:22 PM

$db->whatever is a method defined by vbulletin. Unless you include global.php or init.php in your files, you cannot use that method - you will get the error you got.

PanterSi 10-29-2009 07:31 AM

$thread = mysql_query($strSQL); give me the correct result, even if I didnt declare connection. Is connection inhereted from vb?

Lynne 10-29-2009 04:03 PM

I believe so, yes.


All times are GMT. The time now is 01:18 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.01209 seconds
  • Memory Usage 1,708KB
  • 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
  • (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