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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.