View Single Post
Old 02-01-2007, 11:40 AM  
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
would be better to pull templates from flat file, as your way adds an unneeded query that could cripple your server under high loads

example:

create a file say post.html and put it in templates folder

then put variables such as ##header## in that file then create a php page with this code

$SQL = mysql_query("SELECT * FROM Table WHERE ID = '1'");
$Data = mysql_fetch_ojbect($SQL);
$Template = file_get_contents("templates/post.html");
$Output = str_replace("##header##", $Data->Title, $Template);
echo $Output;

Last edited by Bro Media - BANNED FOR LIFE; 02-01-2007 at 11:43 AM..
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook