The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Functions and queries
I have a quick question about functions.
Say you call a function in index.php, called getsubforums(), that exists within functions.php. This function (which might need variables passed to it) will call queries within itself to get the subforums of each forum generated in index.php, when called. Now, if I did this without the function and hardcode it all into index.php, would that generate the same amount of queries to contrast if I did it within functions.php? Or would the queries called in functions.php not be visible (like in vbmicrostats) for index.php? I'll be amazed if anybody can understand what I just asked... But it's worth a try.. I'm asking it for this hack also, which generates tons of queries although the hack is very useful: https://vborg.vbsupport.ru/showthrea...545#post285545 |
#2
|
||||
|
||||
Ummm... if I am on the right tracks of what you are saying, then, the same amount of queries will be executed no matter where it gets executed from, as long as the code is pretty much the same (no extra queries added).
Perhaps the main consideration would be where to place the code, for better PHP interpretation (not really a biggie though). Placing the function inside a script that's called into pretty much every script, will cause the interpreter to have to skip the function code for every script that is exectuted (until called)... whereas, if you place the code inside the index.php for example, then the interpreter deals with it only in that script. |
#3
|
||||
|
||||
Well, the main thing I wanted to know is if the same amount of queries would be added to that page, if called in a function located in another file. And you've answered that question, so thanks
|
#4
|
||||
|
||||
If you query your MYSQL database (whether inside or outside a function), of course same amount of query load you will create for your server. Well if you are asking if this query load will be displayed or not via Nakkid's Hack, I dont know, but I believe yes it would. But does it matter? If your page is making 1000 SQL quaires to your MYSQL server and it shows only 3 has been made, what would it be for? You have still created 1000 query load whether it's hidden or obvious to page visitors.. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|