embedding PHP in MySQL
| From: | Michael Winston | Date: | Thu, 18 Sep 2003 15:19:32 +0000 |
| Subject: | embedding PHP in MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163013@lists.php.net to get a copy of this message | ||
I've been working on this for a few days and can't get it.
I would like to stick some php code into a sql databases and be able to evaluate it when it's called up.
Foe example, let's say there's some text in a table in MySql that says "blah blah blah <? $mysql_query("SELECT * FROM X WHERE 1); $someothercode; ?> blah blah blah blah blah". I wan the end, displaying result to be: "blah blah blah {executed php code} blah blah blah blah".
Now, I know that eval() is involved, but I don't want it accidentally executing code outside the "<? ?>" so I need a way to pluck out bits of code, evaluate them, and put them back in.
Any ideas?
Thanks,
Michael