For the database, read some docs about database design.
There is a nice article here about database normalisation.
A must if you are making a big database.
Ofcourse this brings with it the complex join statements, but those are only difficult for humans. Database servers love them.
Take time to design your database, don't think about changing your design later unless you like to spend your working hours in database hell.
This means making your columns the right types, and the right sizes.
Use the varchar, not the char. Use Not Null on everything.
Make sure you create the right indexes on your tables.
Use the SQL explain function to find out if your indexes are making sense.
If you are going to be deleting records from your tables, don't forget to "optimize" your tables once in a while, it helps keep your tables small and fast.
Give your database server memory. Lots of it.
For the PHP:
Have a look at the php.ini. There are a few tricks in there to help optimize the speed of php.
Try out different approaches to getting data from sql into php.
In one application I found that it was significantly slower to use the mysql_fetch_array() function than to use the mysql_fetch_row().
Use the microtime() function in PHP to get a timestamp before and after you run the query, that way you can see an estimate of how long it took.
When printing output, don't flush() before you finish the page (unless you really have to). It slows things up.
And finally: let the database server do the database work like sorting and storing temporary result tables.
Don't fetch an array of data and let PHP do a bubblersort.
Trust me, the database does that sort of thing much faster than php ever could :-)
And finally, the smaller your code is, the faster it is.
PHP takes time to read code. If you create a large include file, php will spend your precious cpu cycles parsing that before it gets to the bit you want.