The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Difference between $vbulletin->db and $db->
Hello all,
I think the code below which is within a plugin crashed my server! I was wondering if it was due to the use of $vbulletin->db and $db in the same function? For example: Code:
$search_sql = "SELECT threadid, title, lastpost, forumid, replycount, dateline, postuserid, visible, open FROM " . TABLE_PREFIX . "thread AS thread WHERE NOT ISNULL(threadid) AND visible = '1' AND replycount > '0' AND open!='10' AND forumid IN (".$forums_to_search.") $mp_stats_timecut_activethreads ORDER BY replycount DESC LIMIT 0, $num_of_threads_to_display"; $active_threads_result = $vbulletin->db->query_read($search_sql); $threadcount = $db->num_rows($active_threads_result); # now get the results and add to an array while ($thread_result = $db->fetch_array($active_threads_result)){ ...... { I copied the sql and code bits from a well known plugin mentioned in this forum and it worked well when I was the only one calling the plugin however when I added the plugin to the forum home template and accessible to the public my server used all its memory and swap and had to be rebooted. There are two code blocks in the plugin which execute SQL for stats (the other is along the same lines). I am unsure of why there are two access points used for the db calls ($vbulletin->db, $db) and I wonder if this is actually quite bad? For example wouldn't you go: Quote:
Quote:
Cheers Marc |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|