Re: Re: Eval var from query

From: Date: Mon, 14 Jul 2003 19:23:25 +0000
Subject: Re: Re: Eval var from query
Groups: php.general 
Request: Send a blank email to php-general+get-155150@lists.php.net to get a copy of this message
The string you send to eval() must be valid PHP code. So try this.. eval( 'echo "'.$data.'";'); - Kevin ----- Original Message ----- From: "Shawn McKenzie" <nospam@mckenzies.net> To: <php-general@lists.php.net> Sent: Monday, July 14, 2003 1:15 PM Subject: [PHP] Re: Eval var from query > eval($data) > > returns Parse error: parse error, unexpected T_STRING in > C:\apps\apache2\htdocs\test\query.php(23) : eval()'d code on line 1 > > Thanks! > Shawn > > "Shawn McKenzie" <nospam@mckenzies.net> wrote in message > news:20030714190325.34064.qmail@pb1.pair.com... > > 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 > > > > TIA, > > Shawn > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#155150) next »