![]() |
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:
|
A 'return' statement leaves the function and returns control to the calling script.
|
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. |
No, you should not return there. Instead you would probably want to evaluate the code you have just read from the database.
|
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. |
Well that was my first answer. ;)
|
Quote:
|
Think you want something like this:
PHP Code:
PHP Code:
nJoy |
All times are GMT. The time now is 04:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|