Is it an error, or just a warning? You can suppress the warning by putting an @ symbol before the mysql_connect command.
$link_id = @mysql_connect("host","user","pass");
Your best bet would be to remove the second attemp at connecting to the database. If you can't, then maybe just suppress the warning. Another option would be to check if a link is already open before you try to establish one. I always call my database links $link_id, like in the example above. So you could use something like this...
if (!isset($link_id))
{
$link_id = mysql_connect("host","user","pass");
}
Hope that helps...
---John Holmes...