I am trying to retrieve, and render, php code that's been saved in a mysql table. when i retrieve it and echo it, it simply echoes whatever text is there, it doesn't actually render the php even though it's in <?php ?> tags. it even prints the tags as-is.
Just what am I missing exactly to make this work?
I couldn't find much on google or on here about this. Any help would be greatly appreciated.
as an example, i have this saved in a table:
<? echo 'test'; ?>
I am querying for this like so:
<?
//retrieve subComponent data
$compQuery = mysql_query("SELECT content FROM subComponents WHERE id = '".$_GET['sub']."'");
$comp = mysql_fetch_assoc($compQuery);
?>
and displaying like so:
<?=$comp['content'];?>
now, i want it, to simply render the php from the db and it should just display 'test'.
instead, it's actually displaying <? echo 'test'; ?>
not sure how to get it to actually render the php that's saved.