mysql
WWW.MYHIBRID.COM asked:


I know how pull data from the database but I have stored within the a mysql field some text data. Within that that text I have put in some php variables. The problem is that when the browser renders the data that pulled from my sql, the variable stays as $user for example rather than changing to what I needed to. Is there any way to have the server process the php code stored within the mysql database?

Comments

dhvrm on 13 October, 2008 at 9:36 am #

If you mean you have stored some page code in a MySQL field; in that data, there is PHP code; and you want that data to be evaluated as PHP code, you just call eval().


lordgun2 on 14 October, 2008 at 10:05 am #

You can use json : it handles encoding/decoding variables.

If you have a big object like $object, insert into mysql json_encode($object) and later you’ll be able to retrieve it by using $object=json_decode($data)
where $data is the correct mysql field


Post a Comment
Name:
Email:
Website:
Comments: