Fw: [PHP] MySQL for storing PHP code
| From: | Kevin Stone | Date: | Mon, 10 Feb 2003 21:32:53 +0000 |
| Subject: | Fw: [PHP] MySQL for storing PHP code | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135117@lists.php.net to get a copy of this message | ||
Check out eval();
http://www.php.net/manual/en/function.eval.php
- Kevin
----- Original Message -----
From: "Daniel Page" <dlp@dlpage.com>
To: <php-general@lists.php.net>
Sent: Monday, February 10, 2003 2:21 PM
Subject: [PHP] MySQL for storing PHP code
> Hi,
>
> Would it be possible to store PHP code in a MySQL table, then via a web
> page, connect to the DB, recover the code that corresponds to a certain id
> number, then include that code for execution?
>
> For example (quick, dirty, and untested!):
>
> $sql = "SELECT phpcode FROM phpstorage WHERE codeid = 1";
> $result = mysql_query($sql);
> $_php_code = mysql_result($result, 0,"phpcode");
> echo $_php_code;
>
> Will the echo (or print() ) just output code that can be read by the
reader
> of the page, or will it generate output that will be executed?
>
> If the echo/print does not work, is there another way to do this?
>
> Cheers,
> Daniel
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>