The initial setting for php is 30 seconds to parse/create a page. If it takes longer, then php stops (you can set this in the php.ini file or possibly with ini_set())
If your script takes longer than 30 seconds to parse/create, I agree with Pontaloo that you need to find out why. Just calling 5 tables probly isn't the reason, but if your db is running slow that might cause it.
I'm running apache, mysql, and loading a labor-intensive shopping cart locally on a 366mhz laptop....I had to do the same thing to the php.ini file. I changed the max load time to 180 seconds....but I still have to find the problem of why it takes so long.