what one is better faster to use as i am making a template system for my project and i do not know what one i should use or is there any other function that can show content???
Printable View
what one is better faster to use as i am making a template system for my project and i do not know what one i should use or is there any other function that can show content???
Why would you not just use MySQL for a template system? Instead of reading flat files?
so have all the html and css stored in the database?? would that not make the load time big in the sql server?
Not unless its like, uber slow, it probably takes more time opening an instance of a file, reading it, then closing it, then it does to pull it ouf ot the database.
You could have a table called `templates`:
name
value
Example:
Name: header
Value: <html><head><title>hey</title></head> <body>
Name: footer
Value: <center>Copyright!</center></body></html>
PHP Code:<?php
function get_template ($template_name) {
$query = mysql_query("SELECT name, value FROM templates WHERE name='$template_name' LIMIT 0,1");
$row = mysql_fetch_array($query);
echo $row["value"];
}
?>
hmm i could do some thing like that then all i have to do is make a template editing system (that would be easy).
thank you MountainDew.
No problem,
think of it this way.
When you do it flat-file,
1. Create connection to the file.
2. Read the file and store it in the variable.
3. Close file.
MySQL (Pre-connected)
1. Query.
2. Echo.
i wanna have ur babiesssssss
Edited by Agesilaus (Forum Moderator): Please do not post off topic.
Flat file is more efficient for a template system
i am going mysql as of the this point
and also will be a lot easier for people to skin it as it will have a skinning manager. fast and easy to use.Quote:
Originally Posted by MountainDew