Re: Eval var from query
| From: | David Nicholson | Date: | Mon, 14 Jul 2003 19:06:46 +0000 |
| Subject: | Re: Eval var from query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155147@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Mon, 14 Jul 2003 at 20:03,
lines prefixed by '>' were originally written by you.
> How can I evaluate a var that is from a text field of a database?
> Example:
> MySQL field
name = hi my name is $name
> In my script I have:
> $name = "Shawn";
> After fetching a query result as an associative array I have the
> contents of
> the name field in $data
> If I echo $data I get: hi my name is $name
> I would like to get: hi my name is Shawn
Use eval($data)
See http://uk.php.net/eval for more info.
All the best,
David.
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)