Hello,
We have a proprietary database which we can connect to through a C-callable dynamic load library. Opening a connection to this database returns a small array variable (four integers), i.e. a database handle, which we can use to manage the connection.
We want to open one of these database connections via a PHP-driven web-page, interact with the database handle in a series of operations, and then exit.
In order to do this we have wrapped a mod_php dynamically-loadable module around the database library, giving us the following cascade:
Proprietary database shared-object library
PHP dynamically-loadable wrapper
mod_php4
apache
PHP scripts referencing the database handle
The question is, what do we need to do to make sure that during a single set of user interactions with this database, modifications and requests to the database four-integer handle are always interacting with the same instance of the proprietary database-connection library?
This must have something to do with PHP sessions and/or persistent connections but other than that we're lost.
Thanks!if you connect to the database then what reason would it have to disconnect?
maybe I am not understanding but if you connect to it then you have all day to run it. I know you are using a funky database so I can't really comment on it, but if it is like mysql or any other database then once you connect it should stay connected unless you tell it to disconnect.
if you are losing connection then maybe you need to look at the database and not the script. or you can keep what makes the connection in a session so everytime a page loads it has the info.
was I closer this time? thanks - you were closer
we are experimenting with using sessions to generate a session_id() with the four integers that make up the database handle.
a quick question about sessions - the main page where we call the dynamic load of the library - do I have to put session_start() at the top of that page, or can I put session_start() in the function that is called by the initial page once the dynamic library is loaded?
:cheers:session_start ha sto be on any page you want to use sessions for.
it will generate header already sent errors if you have html going out before it.
We have a proprietary database which we can connect to through a C-callable dynamic load library. Opening a connection to this database returns a small array variable (four integers), i.e. a database handle, which we can use to manage the connection.
We want to open one of these database connections via a PHP-driven web-page, interact with the database handle in a series of operations, and then exit.
In order to do this we have wrapped a mod_php dynamically-loadable module around the database library, giving us the following cascade:
Proprietary database shared-object library
PHP dynamically-loadable wrapper
mod_php4
apache
PHP scripts referencing the database handle
The question is, what do we need to do to make sure that during a single set of user interactions with this database, modifications and requests to the database four-integer handle are always interacting with the same instance of the proprietary database-connection library?
This must have something to do with PHP sessions and/or persistent connections but other than that we're lost.
Thanks!if you connect to the database then what reason would it have to disconnect?
maybe I am not understanding but if you connect to it then you have all day to run it. I know you are using a funky database so I can't really comment on it, but if it is like mysql or any other database then once you connect it should stay connected unless you tell it to disconnect.
if you are losing connection then maybe you need to look at the database and not the script. or you can keep what makes the connection in a session so everytime a page loads it has the info.
was I closer this time? thanks - you were closer
we are experimenting with using sessions to generate a session_id() with the four integers that make up the database handle.
a quick question about sessions - the main page where we call the dynamic load of the library - do I have to put session_start() at the top of that page, or can I put session_start() in the function that is called by the initial page once the dynamic library is loaded?
:cheers:session_start ha sto be on any page you want to use sessions for.
it will generate header already sent errors if you have html going out before it.