Jump to content

Page won't process PHP....


derekbelcher

Recommended Posts

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

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.