WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this Article to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES SUBMIT AN ARTICLE PRINT
Title : Static HTML Generation With PHP
Categories : PHP, HTML and PHP
phpfreaks.com
phpfreaks.com
Date : 2002-08-28
Grade : 1 of 5 (graded 1 times)
Viewed : 9048
Search : More Articles by phpfreaks.com
Action : Grade This Article
Tools : My Favotite Articles


Submit your own code examples 
 


When you are running a large volume website that requires alot of mysql_query action you'll probably want to consider ways to reduce the impact of your server's performance. We can do this by generating static html pages from the pages that require all of these queries. By writing a few simple PHP scripts you can prepare to CRON your PHP driven site and have it automatically update for you at set intervals. Or you can have direct control over the updates via your web browser. This makes your website run alot faster and reduces your MySQL database queries dramatically.

Let's say that we have a tutorial index just like on phpfreaks.com. This tutorial index starts out by pulling queries for the following:

First Query:
Category ID (auto incremented number)
Category Title
Category Description

Second Query Based on cat_id from First Query:
Tutorial ID (auto incremented number)
Tutorial Title
Tutorial Caption
Tutorial Date
Tutorial Read Count
Tutorial Author ID

Third Query:
Get the Author's Name from the authors table where the author_id FROM second query matches the author's ID in the authors table. (We like to keep this dynamic in case the author changes his/her name later on.)

As you can see, the above queries are not that dramatic. In fact, it's quite a small query compared to some functions that you can get into using PHP and MySQL. Let's think about it this way. I can run this query every single time a reader clicks on our tutorial index page or I can generate a static HTML page that updates every 12 hours to update the information on the index page or I can just let the queries run every time the page is viewed. When you get about 2,000 page views of your index a day, that's about 6,000 queries right there. Why do that when we can do 6 queries a day?

Let's learn how to minimize the impact of your server on the next page.

Read More...









Sending Form Data in EMail
Categories : PHP, Email, HTML and PHP
Uploading files to the server with PHP
Categories : PHP, File System, HTML and PHP, HTTP
Alternating row colors with PHP and mySQL
Categories : PHP, Databases, MySQL, HTML and PHP
tracking where and what on your site people are clicking
Categories : PHP, MySQL, HTML and PHP, HTML
Multicolumn Output from a Database with PHP
Categories : PHP, Databases, HTML and PHP, MySQL
How To add paging (Pagination) with PHP and MySQL
Categories : PHP, Beginner Guides, Databases, MySQL, HTML and PHP
Making PHP Forms Object-Oriented
Categories : PHP, HTML and PHP, Object Oriented
Previous and Next Links
Categories : PHP, HTML and PHP
Webstatistics with Redirectors
Categories : PHP, HTML, HTML and PHP
Function Based PHP
Categories : PHP, Functions
Simple Connection to Sybase with PHP
Categories : PHP, Sybase, Databases
Building XML Web Services with PHP NuSOAP
Categories : PHP, NuSOAP, XML
Introduction to WAP using WML, ASP and PHP
Categories : PHP, WAP, WML
Web Development With PHP FastTemplate
Categories : PHP, Templates, FDF
Counting - Creating a more sophisticated GIF based counter using PHP and MySQL
Categories : Beginner Guides, MySQL, PHP, To PHP, To MySQL