vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to get a field from mysql in a plugin (official way) (https://vborg.vbsupport.ru/showthread.php?t=216841)

mortydot 06-22-2009 07:42 PM

How to get a field from mysql in a plugin (official way)
 
Hello every one,

To begin, I have build a mod that retrieves some variables from the database. Because i'm new to the VBulletin mod coding, i have first build it on my own way (opening mysql connection, closing it, etc.)

But I believe there is another way to do this what is shorter, faster and creates a lower load.
Is there a connection already setup? How do I do this the official VBMod way? (is there one?)

I need an example for just getting one singe field from a table. Or better, a tutorial/article about this.

Looking forward for any replays! (the sooner I can make my mod official :)

Lynne 06-22-2009 07:46 PM

If you are using the plugin system, then you should be able to just go "$db->query_read" or "$db->query_write" for you query. You should download a modification that is here to see how they do it. Also, take a look in the articles forums for some articles on products and plugins.

Dismounted 06-23-2009 10:00 AM

You may also be interested in this document: vBulletin Code Standards.

mortydot 06-28-2009 02:34 PM

Great :)

Thnks!

I'm rolling again!


All times are GMT. The time now is 03:13 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.00914 seconds
  • Memory Usage 1,711KB
  • 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