The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
need help about function
plz look at these 3 types of code
type 1: PHP Code:
type 2: PHP Code:
type 3: PHP Code:
i tried all 3 of those....type 1 didn't work. type 2 & 3 work but i dont want to use type 2....coz everytime i use that function it will connect to DB & waste a lot of resource. if i use this function 10 times in a page, it will connect to DB 10 times....too bad! but not sure about type 3....what about it? is it waste resource like type 2 ?? help me plz |
#2
|
|||
|
|||
<font size="3">too bad...ppl r not willing to help, these days</font>
|
#3
|
|||
|
|||
I'm not sure many people would know the answer to that, I know I don't... Sorry, but be patient someone might
|
#4
|
||||
|
||||
I don't understand what you are trying to do, so I can't really help. It's hard to look at such a general piece of code and make comments. All I can say is I wouldn't go for number 2. I wouldn't really go for any of them since you are grabbing the whole table. I would think you would only need some of it.
|
#5
|
|||
|
|||
ok, in a page im using a function more than 10 times.
inside that function i need to call a DB table. yes lynne u r right, i dont wanna use Type-2 too. but what about type-3 ? when declare global $query....i just want to know, is it connect to DB everytime u use that function in this case or not. |
#6
|
||||
|
||||
Type 3 should not be connecting to the database everytime the function is called. However, I have to wonder why you are using a function just to spit something out. That seems unnecessary.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|