Re:SOLVED [PHP] How to parse db-stored code

From: Date: Wed, 20 Mar 2002 11:24:20 +0000
Subject: Re:SOLVED [PHP] How to parse db-stored code
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-89314@lists.php.net to get a copy of this message
At 20.03.2002 12:17, you wrote: SOLVED !
I have stored several selects in a mysql-db, it is possible to parse the answer, but I couldn´t remember how. f.e. > the answer on a query is: select * from somewhere where foo='$foo' and foofoo='$foofoo' this is a string, what is the method to make the $foo-vars "real" vars? i would say, you can either do
     $val = $$whatYouGotFromTheDB;
or
     eval ( "\$val=".$whatYouGotFromTheDB );
where $whatYouGotFromTheDB = '$foo'; should work either way, good luck
Thanks for the quick answer, I meant eval(). Oliver

« previous php.general (#89314) next »