The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
while loop in a function
I am doing the hook system in my own scripts but I have a small problem.
It only returns the first hook that matches $hook_name. How do I have it return all the rows where the hook_names match? PHP Code:
|
#2
|
|||
|
|||
A 'return' statement leaves the function and returns control to the calling script.
|
#3
|
|||
|
|||
So I'll need to check if I got every field where hook_name = $hook_name?
I don't know how to do this offhand, hopefully I'll find it easily. |
#4
|
|||
|
|||
No, you should not return there. Instead you would probably want to evaluate the code you have just read from the database.
|
#5
|
|||
|
|||
It occured to me that I was using return in the while loop so I took it out of the while loop and now it works.
That's another lesson learned. Thanks for the help though. |
#6
|
|||
|
|||
Well that was my first answer.
|
#7
|
|||
|
|||
Quote:
|
#8
|
||||
|
||||
Think you want something like this:
PHP Code:
PHP Code:
nJoy |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|