public static function closeConnection($conn = null) { if ($conn !== null) { mysql_close($conn); return; } if (self::$connection !== null) { mysql_close(self::$connection); } self::$connection = null; }