|
|
| |
1. how to use this in a custom function |
|
Reply |
|
|
 leocrawf stewart | 2012-11-09 06:50:48 |
I want to use this in a custom function but it does not work. here is my code:
require_once('../../includes/mySession.class.php');
require_once('../../includes/mySession.conf.php');
$session = mySession::getIstance($_MYSESSION_CONF);
function customFunction(){
//get custom db connection
$session->save("foo","bar");
}
I get a "Undefined variable: session"; |
| |
2. Re: how to use this in a custom function |
|
Reply |
|
|
 Jaroslav | 2012-11-21 10:55:07 - In reply to message 1 from leocrawf stewart |
Hi,
try
function customFunction($session){
//get custom db connection
$session->save("foo","bar");
}
or
function customFunction($session){
global $session;
//get custom db connection
$session->save("foo","bar");
}
;) |
|