Re: what am I missing..interpolation?
| From: | Justin Gruenberg | Date: | Sun, 15 May 2005 14:04:33 +0000 |
| Subject: | Re: what am I missing..interpolation? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-215255@lists.php.net to get a copy of this message | ||
On 15/05/05, blackwater dev <blackwaterdev@gmail.com> wrote:
> Hello,
>
> this works fine:
>
> $name="fido";
> $string="my dog's name is $name";
> echo $string;//prints my dog's name is fido
>
> but when I store the string "my dog's name is $name" in the db and pull it out:
>
> //do the query
> $row=$datab->fetch();
> $name="fido";
> $string=$name['db_column'];
> echo $string//prints my dog's name is $name
>
> How can I get it to work with the db?
Not exactly sure if this will work, but try
echo eval($string)