Let's look at this:
$link = mysql_connect("localhost", "", "");
if ($link == 1){
What goes here to load www.site.com in Frame2
}
mysql_close($link);
So then, "What goes here to load www.site.com in Frame2" would be the echoed Javascript. That javascript would be the standard opening and closing SCRIPT tags. The code itself would be something like location.href = yourPage.php that would target Frame2.
Do a Google for "frames javascript", and you should get some clues on how to use JavaScript in Frame1 to change the location of Frame2. Sorry, but I can't recall the exact syntax at the moment. Just remember that PHP will need to echo out the JavaScript.
Hiji