Re: Function stored in a database
| From: | Robert Cummings | Date: | Tue, 09 Apr 2002 17:06:30 +0000 |
| Subject: | Re: Function stored in a database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92254@lists.php.net to get a copy of this message | ||
Anzak Wolf wrote:
>
> I have a question about storing functions. I have some security mode stuff
> I'm working on and what I'm thinking is that as part of the security mode
> table I would store a function that could be called if the security mode is
> called.
>
> Something like this.
> Select s.function from s Security g group where g.Group_name = "something"
>
> I know I have the syntax wrong but this is just pseudo code.
>
> Now in my php I would have something like this.
>
> $func = get_row($result)
>
> $func();
>
> Would that work.
This should work fine... though it might be a good idea to wrap
the $func() call in an if( function_exists( $func ) ) test :)
Cheers,
Rob.
--
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer |
:----------------------------------------------:
| Mail : mailto:robert.cummings@webmotion.com |
| Phone : (613) 731-4046 x.109 |
:----------------------------------------------:
| Website : http://www.webmotion.com |
| Fax : (613) 260-9545 |
`----------------------------------------------'