I am trying to write a function that closes the connection created in the following class:
to open a connection, I type: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);
}
}
I know the function closeConnect() isn't working. What will make it work?PHP Code:$connection1-> new dbConnect();
$sql=$connection1->connect($dataB);


Reply With Quote

Bookmarks