Reply to Newbie Sessions, session variables/objects and ADODB question

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация