从数据库中检索时,在HTML中嵌入PHP代码不起作用

I have an HTML template that is populated with information from a database and echo'd to user as a complete page. Inside one of the fields that is echo'd I tried to insert some php code e.g. but hello doesn't appear to the user, and when I check the source, it is red (nothing appears on the users screen). why would this be? I though that as long as you have a .php file you can embed php code no problem with html. Don't ask why I have the php code stored in a database, it's complicated!

You would need to use PHP's eval() function, please be careful with this though as it can pose a security risk.

You should really address the underlying issue of why you are storing PHP code in a database.