The problem being that I don't really.
I have a small code snippet here I was hoping somebody could find fault in and show me the correct way of doing what I'm trying to do.
$pagebits = mysql_query("SELECT * FROM page WHERE page='$action' ORDER BY date");
while ($array = mysql_fetch_array($result)) {
$pagebit = getTemplate('pagebit');
$pagebit = str_replace("<pagebit_title>", $array['ptitle'], $pagebit);
$pagebit = str_replace("<pagebit_content>", $array['pcontent'], $pagebit);
echo "$pagebit<br />";
}
This is effectively a template system but the problem is that I haven't managed to successfully take variables from a database and insert them into (on display) a template which corresponds to that page. In the code above I'm simply trying to replace html-like tags with the variables right out of the database but it hasn't been going so well.