PDA

View Full Version : How to get a field from mysql in a plugin (official way)


mortydot
06-22-2009, 07:42 PM
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 (http://www.vbulletin.com/docs/html/codestandards).

mortydot
06-28-2009, 02:34 PM
Great :)

Thnks!

I'm rolling again!