|
Posted by Brendan on 02/13/06 14:04
I a writing my first PHP 5 web application.
I don't want to use global variables.
I'm using the normal PHP 5 sessions, not the ADODB sessions.
I'd like to add the ADODB connection object to the session using a session
varible and then use the connection object on a different page by
referencing the connection object in the session. (I don't want the overhead
of having to connect to the database) Is this even possible and if not what
is the best way of going about this? eg.
----------------------------------
===========
Login.php
===========
session_start();
....
$conn = &ADONewConnection('borland_ibase');
$conn->PConnect($databasename,$username,$userpassword);
....
$_SESSION['connection'] = $conn;
==========
LoggedIn.php
==========
session_start();
....
$conn = $_SESSION['connection'];
$recordSet = &$conn->Execute('select * from table');
---------------------------------------
So afr I know I'm on the wrong track. Would anyone care to let me know the
proper way of going about this?
Thanks in advance
Brendan
Navigation:
[Reply to this message]
|