I have a php code snippet like below :
function is_ancestor_of( $page_name = null, $post ) {
if(is_null($page_name))
return false;
// does
You will need to use mysql_real_escape_string() to escape the php code so it does not throw an error when inserting. Then you run an eval() on the statement, if you want it to execute. If you have a mixed html and php stored in the database you would call eval like so
eval('?>'.$dbresult.'
Just make sure you stripslashes() on the database result