Forums | MacLife
You are not logged in.
#1 2003-01-18 12:45 pm
Executing PHP Code Stored in a DB
Can this be done? I know I could read the code, write it to a file, and then use the import function to execute that file, but is there any more efficient way available? Until one of my latest projects, I've never had a need really to store the code itself in the database, but if this can be done efficiently, it will make one of my current projects a lot more robust.
Thanks,
-Dan
Offline
#2 2003-01-18 2:42 pm
- lostghost
- Member
- From: Chicago
- Registered: 2001-07-08
- Posts: 496
Re: Executing PHP Code Stored in a DB
You can execute any string as PHP code using the eval() function:
http://www.php.net/manual/en/function.eval.php
Offline
#3 2003-01-18 3:06 pm
Re: Executing PHP Code Stored in a DB
You can execute any string as PHP code using the eval() function:
http://www.php.net/manual/en/function.eval.php
Heh, thanks. I found that about 5 minutes after I asked the question -- next time I think I'll RTFM before I ask the question. 
Offline

