Re: Storing Code in a db?
| From: | Christopher Ostmo | Date: | Thu, 28 Jun 2001 06:57:48 +0000 |
| Subject: | Re: Storing Code in a db? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9879@lists.php.net to get a copy of this message | ||
Mark @ 10base-t pressed the little lettered thingies in this order...
> Hey there,
> Is it possible to store code like a function, for example, in a mysql
> database and pull it into a php dynamicallly so you can use the function if
> needed?
>
Yes, it is possible, but you need to run the code through eval() for it to
do anything useful.
ie
while ($row = mysql_fetch_row($result)) {
echo eval($row[0]);
}
Good luck...
Christopher Ostmo
a.k.a. tech@AppIdeas.com
AppIdeas.com
Meeting cutting edge dynamic
web site needs
For a good time,
http://www.AppIdeas.com/