Using Connections in a PHP Loop