I am trying to write a function that closes the connection created in the following class:

PHP Code:
class dbConnect {
    
    function 
connect($dataB) {
        
$conn=mysql_connect("127.0.0.1","username","password") or die (mysql_error());
        
$db=mysql_select_db($dataB,$conn) or die ("Unable to connect to database1"); 
    }

        function 
closeConnect($conn) {
        
mysql_close($conn);
    }

to open a connection, I type:
PHP Code:
$connection1-> new dbConnect();
$sql=$connection1->connect($dataB); 
I know the function closeConnect() isn't working. What will make it work?