Why not use one mysq_connect for the content of all three framesets? When are the queries made in relation to when the output is returned to the browser? If you do all of the queries BEFORE you begin creating the individual frames, it should be no problem.
Now how you're creating three documents with one script, I don't know, but I'm assuming you're doing it and that's good enough for me.
Later on,
Morpheus()