Jump to content

displayin <?PHP?> stored in MySQL


theblacksheep

Recommended Posts

Hello,

I am converting a clients website over so then it becomes database driven, content wise anyway.

I get the data from the database but when it tries to run the php code stored in the db field "content" which is calling information from another part of the db using a standard query, it only displays random characters.

 

I believe it may have something to do with mysql sending the data as a string. Is there a better data type if this is the case?

Link to comment
https://forums.phpfreaks.com/topic/164036-displayin-stored-in-mysql/
Share on other sites

A database driven web site means just the content is stored in a database, not the php code that displays that content. For example, on this site, the content of the posts are stored in a database. The php code that displays those posts is not stored in a database.

 

And if you have content that has replaceable parameters in it, you use a template engine (from a simple str_ireplace() statement to a full blown 3rd party one like smarty) to manage the replacement of the parameters with the actual values when it is displayed.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.