Fatal error in PHP

I have written some code in PHP but when i execute it it give some error:

CODE


<html>
<body>
<?
include_once 'DB.php' ;
$dbh = NULL ;

function on_session_start( $save_path, $session_name )
{
global $dbh;
$dbh = DB::connect('mysql://mithilesh:classic@localhost/SITE_SESSIONS',true);

if (DB::isError($dbh))
{
die(sprintf('Error [%d]: %s',$dbh -> getCode(), $dbh -> getMessage()));
}

}


ERROR


Fatal error: Cannot redeclare on_session_start() in d:\mith\php\DB.php on line 7


Please help me for solving this problem.

Thank you

 

 

 

 

Top