Q:

How can I run both php and html code from MySQL?

I have a mysql table that stores php codes and html codes. Let's say this code is inside that table:
<html>
<head>
<title><?php echo $PageName; ?></title>
</head>
<body>
<?
echo $PageContent;
?>
</body>
</html>

what I want to do is to echo the variable's value and not the code itself.
I researched about this, then I found eval(); ,but unfortunately it only works on php codes so whenever I type html codes it will say unexpected '<' in line 1, this is because eval() doesn't recognize the html code. Can you give me a code that works for this?
Clarification: What I mean is that when I get the code from the database I want it to execute, not to echo the entire code. thanks

A:

You would have to do a SELECT * FROM tbl_name, they put everything into a $mysql_fetch_assoc() function.
Something like this: 
$result = mysql_query("SELECT * FROM website");
$row = mysql_fetch_assoc($result);
$row['page_title'];
$row['page_content'];

