I'm trying to create a session in Zend
as follows:
if (isset($_POST['login'])) {
Zend_Session::start();
$session = new Zend_Session_Namespace();
$login = explode('-', $_POST['login']);
$codigo = $login[1];
$banco = $admin->fetchAll('SELECT banco FROM tbl_clientes WHERE codigo = ' . $codigo);
Zend_Registry::set('banco', $banco[0]['banco']);
$session->banco = $banco[0]['banco'];
}
However when trying to access the $session->banco
variable on another page it just does not exist!
OBS.
As soon as I assign the value of it, it gets the value of $banco[0]['banco']
.
Normally, I need this value to be able to set defaultAdapter
of Zend_Db_Table
and make it available in the application so I can access the database.
This bank will be on a record in the query that I'm doing above.
I was trying to handle all this in Bootstrap.php
but I saw that it is not very sure, any way I'm having trouble saving this information, the bank returns me the following error:
'No adapter found for models_DbTable_TblChamado'
If there is a better way to do this, I'm open to suggestions.