Another interesting way to crash a server

I was setting up another site with a paid for membership system and since I´m reeeally lazy I just get the server to do all the admin stuff through cron jobs and php scripts. One of these does a daily check to find the users that signed up a year ago and then generate a new invoice and print it out in the office.
 

Since I´d done this before on other projects I just went and copied the file over and then made a few changes to the database details and the folder info in it. As I was just checking through the code I noticed the way that it checked for the users that needed renewing was, well… stupid.
 
I wrote the code ages ago when I were but knee-high to a grass-hopper type thing, plus I might of been hung over. Insted of sending a mysql query asking for a list of users whose sign up times fall between two times (ie now and 24 hours from now) and then dealing with them, I was asking for ALL the users, seeing if the sign up time fell between the two values and then if it did, do the whatever.
 
Since this code gets used on about 10 sites which are all hosted on the same server, and all the scripts get run at the same time daily, it puts a bit of a strain on the server. Luckily I found this out while most of the sites only had about 500 members so the server could take it. Could have been fun when they were up in the thousands though.