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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.