Thanks for all your help, but I ma still no closer to finding the problem. I'll try decomiling the whole application, and rewriting it, see it that works. If anyone has a brainwave in the meantime, any further help would be greatly appreciated.
Thanks, Adam Bishop P.S. I have replaced the break command, got rid of the extra foreach loops, re-written mysql_num_rows, and put in a few extra semicolons. [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger