shyne
07-10-2007, 08:59 PM
Hi
I am not sure if this can be done since I couldn't find a way to output a php code I have saved in a mysql database table field.
This is what I want to do:
I want to save a php code in a mysql table "BLOCKS" field name "CODE" for ex:
echo "This is why I am hot lol";
$qblocks = "SELECT * FROM `acyn_pages_blocks` WHERE page_id = '$page_id'";
$rblocks = mysql_query($qblocks);
if (!$rblocks){
die ("Could not query the database:<br />Houston! we have a problem here. ". mysql_error());
}
$b = mysql_fetch_array($rblocks, MYSQL_ASSOC);
echo "blah blah and anything else in php code";
now in my pages.php I want to output the code saved in the mysql database. I can call the code but it prints it as plain php code and does not output the result of the code. Can someone please tell me how can I achieve this so it prints out the actual result of the code, whatever it is.
A little example would be nice. I really need this to work
Thanks
I am not sure if this can be done since I couldn't find a way to output a php code I have saved in a mysql database table field.
This is what I want to do:
I want to save a php code in a mysql table "BLOCKS" field name "CODE" for ex:
echo "This is why I am hot lol";
$qblocks = "SELECT * FROM `acyn_pages_blocks` WHERE page_id = '$page_id'";
$rblocks = mysql_query($qblocks);
if (!$rblocks){
die ("Could not query the database:<br />Houston! we have a problem here. ". mysql_error());
}
$b = mysql_fetch_array($rblocks, MYSQL_ASSOC);
echo "blah blah and anything else in php code";
now in my pages.php I want to output the code saved in the mysql database. I can call the code but it prints it as plain php code and does not output the result of the code. Can someone please tell me how can I achieve this so it prints out the actual result of the code, whatever it is.
A little example would be nice. I really need this to work
Thanks