Session vars
by TBotNik from LinuxQuestions.org on (#5KD8H)
All,
Hate to trouble you but have this code:
Code: session_name ( 'bizlist' );
session_start ( 'bizlist' );
$dbtst = tst_db ();Calling this function:
Code:function tst_db () {
$em_dir = "/mypath/EM/em_dio";
include_once ( "$em_dir/em_dio.php" );
define ( 'DB_USE', 'biz_track' );
$_SESSION ['DB'] = DB_USE;
define 'EM_DIR', "$em_dir" );
$_SESSION ['EM_DIR'] = $em_dir;
echo "ED=> $emdir SD=> $_SESSION ['EM_DIR'] !";
$edb = new em_dio();
$cont = $edb->dbConnect($_SESSION['DB']);
$tstdb = $edb->dbTest($_SESSION['DB']);
if ( $tstdb==1 ) {
echo "DB Connected and Ready! ";
return 1;
} else {
echo "Adding the DB!";
//'mysql -u $USER -pmypass' < 'deffile.sql';
//$dbtst = tst_db ();
return $dbtst;
} // end if mysql_num_rows
} // end function tst-dbbut somehow the $_SESSION vars are not being enabled. Sorry have forgotten the HOWTO troubleshoot this scenario, so all help appreciated!
This function is to test and make sure the MySQL DB exists and is enabled and if not add it to enable processing!
Thnx!
TBNK
Hate to trouble you but have this code:
Code: session_name ( 'bizlist' );
session_start ( 'bizlist' );
$dbtst = tst_db ();Calling this function:
Code:function tst_db () {
$em_dir = "/mypath/EM/em_dio";
include_once ( "$em_dir/em_dio.php" );
define ( 'DB_USE', 'biz_track' );
$_SESSION ['DB'] = DB_USE;
define 'EM_DIR', "$em_dir" );
$_SESSION ['EM_DIR'] = $em_dir;
echo "ED=> $emdir SD=> $_SESSION ['EM_DIR'] !";
$edb = new em_dio();
$cont = $edb->dbConnect($_SESSION['DB']);
$tstdb = $edb->dbTest($_SESSION['DB']);
if ( $tstdb==1 ) {
echo "DB Connected and Ready! ";
return 1;
} else {
echo "Adding the DB!";
//'mysql -u $USER -pmypass' < 'deffile.sql';
//$dbtst = tst_db ();
return $dbtst;
} // end if mysql_num_rows
} // end function tst-dbbut somehow the $_SESSION vars are not being enabled. Sorry have forgotten the HOWTO troubleshoot this scenario, so all help appreciated!
This function is to test and make sure the MySQL DB exists and is enabled and if not add it to enable processing!
Thnx!
TBNK