Re: Parsing of db results by PHP
| From: | Hugh Bothwell | Date: | Sun, 09 Sep 2001 20:29:10 +0000 |
| Subject: | Re: Parsing of db results by PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12275@lists.php.net to get a copy of this message | ||
"Robert Gormley" <robert@seabreeze.asn.au> wrote in message
news:5.1.0.14.2.20010910041550.00b13470@localmail.seabreeze.asn.au...
> Hi all,
>
> I have a MySQL db which contains table test, field test... one of the
> entries is
>
> "<? external($url, $text); ?>"
>
> Where external() is a function i've written which outputs simple text.
>
> I want to be able to put calls to this function into the database, and
have
> them parsed on rendering... With the above example, the raw code is just
> spat to the browser, and doesn't hit the interpreter.
Either trim the string and eval(), or change the database to store just the
contents of $url and $text and do the call to external() in your PHP code.
Personally, I think the second is preferable (by the principle of
orthogonality ;-).