Why is my PHP DB connection not being retained over static function calls?

indigo21

New member
Say this is my class....
<?php
class XXX
{
public static $dbConnection;

public static function initiate()
{
$dbConnection = mysql_connect("localhost", "xxx", "xxx");
}

public static function terminate()
{
mysql_close($dbConnection);
}
}
?>

Now this is the PHP that uses it...
<?php
include("engine/xxx.php");
XXX::initiate();
XXX::terminate();
?>

I've determined that the connection does indeed work, but on the disconnect call it is as if it never was. What's going on?
 
Back
Top