Notice:   Production on vBTeam is down until further notice Read more here!
Notice:   vBTeam will NOT be what it once was NO WAREZ ALLOWED! You may post mods from but do not post any paid mods. (Unless it's yours.)
Notice:   I have personally received permission from Hoxxy to use the old theme (PROOF), and will be adding many custom touches all around.

Articles : Articles specializing in programming and how-to's.

This thread contains 0 Replies and had 4611 views, Last post was by DrCustUmz

New Thread Reply
Mod Options
Working with MySQL in vBulletin
DrCustUmz's Avatar
Join Date: Oct 2020
Posts: 9

Sorry, I'm classified.

In a box
Show Printable Version Email this Page Subscription
DrCustUmz DrCustUmz is offline 11-19-2020

$db (Type: Object) is responsible for all operations in vbulletin.
Method for global use $vbulletin->db, locally $db
  • $db->query();
    Similar to the PHP function mysql_query()
  • $db->query_read();
    For executing SELECT and SHOW queries
  • $db->query_write();
    Executes database modification queries INSERT, REPLACE, UPDATE, DROP, ALTER
  • $db->query_first();
    Similar to query_read(), but returns only the first result as an associative array.
  • $db->num_rows($mysql_resource_var);
    Similar to PHP mysql_num_rows()
  • $db->fetch_array($mysql_resource_var);
    To get all rows of a query result / similar to mysql_fetch_array()
    PHP Code:
    while ($var $db->fetch_array($mysql_resource_var)){
    // your code ($var - is an associative array);

  • $db->mysql_insert_id();
    Returns the identifier of the last INSERT query / similar to mysql_insert_id()
  • $db->escape_string(); and $db->escape_string_like();
    Replaces PHP functions - addslashes() and addslashes_like().
  • $db->show_errors(); and $db->hide_errors();
    SQL error handling. The first function turns on error output. Second vice versa
Reply With Quote
New Thread Reply

Mod Options

database, development, mysql, query, resource
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Design By Hoxxy & DrCustUmz