DB Driven website problem

admin

Administrator
Staff member
Can anyone tell me, is there a way to use php within data from a database.

What I'm doing is using a DB to store nearly all the pages and includes for my site, but these contain php scripts, that currently aren't getting parsed.

I'm using the following method within a function, and then call the function in the template with a index.php?CID=2 type of URL:

---------code start---------

while ($row_web = $result_web->fetchRow(DB_FETCHMODE_ASSOC))
{
$output = '<h1>' . $row_web[COWEBContentTitle] . '</h1>';
$output .= '<br>' . $row_web[COWEBContent] . '<br>';
}
return $output;

---------code end---------

I'm using PEAR DB stuff, but the above is a typical "while thingy" from what I can see, and it DOES output the html...it just doesnt parse PHP if there is any.

Any help here would be much appreciated.

TIA

Simon H
 
Back
Top