[snip]
limit the number of times you need to hit the database.
I second Chris on this. [/snip]
I third that. The problem can become especially apparent in large databases containing millions of records. Other than that just code cleanly and document, document, document.
Creating indexes on columns that appear in your WHERE clauses can drastically increase performance when hitting the database. Be sure to read your database documentation on creating indexes.
A simple example of this would be a "forgot your password" script that emailed a user based on the user's email address. By indexing the email address field, your query will run much faster than without the index, and if you have several thousand records in your table, you will surely notice the difference.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php