most likely you have deleted a recordset from the page but the mysql_free_result() for it was left over.
You can probably delete line 589.
i need to see the original PHP page, not the source after running it in the browser. Please compress the PHP page into a zip archive and send it with your reply.