derekbelcher Posted January 6, 2010 Share Posted January 6, 2010 I am using a database with page id (pid) and a field that is designated as type=longtext. In that field I am putting all my html code and then calling that page id with a simple query. Now the problem. The page where this simple query is located won't process the content if it contains php. I tried a very simple example: <?php Print "Hello, World!"; ?> If I just type in Hello World in the database table, it displays fine on the webpage, but if I try to do it as php, it doesn't display What am I missing. Code that calls the querry: <? $conn = mysql_connect('localhost','dbelcher','wvmcs2009'); mysql_select_db($wvmcsContent, $conn); mysql_select_db('wvmcsContent', $conn) or die( "Unable to select database"); $query="SELECT contenttext FROM content WHERE id = $pid"; $result=mysql_query($query); mysql_close(); $contenttext=mysql_result($result,0,"contenttext"); print("$contenttext"); ?> Information I want to display is in the "content" table in the field, contenttext. Any help? Link to comment https://forums.phpfreaks.com/topic/187368-page-wont-process-php/ Share on other sites More sharing options...
teamatomic Posted January 6, 2010 Share Posted January 6, 2010 Thats one of the uses of eval. http://us.php.net/manual/en/function.eval.php HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/187368-page-wont-process-php/#findComment-989416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.