ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:session:reference:config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
v5:session:reference:config [2016/05/16 00:59] – created mnewnhamv5:session:reference:config [2018/07/01 21:53] (current) – typo in class name peterdd
Line 1: Line 1:
 ====== ADOdb_Session::config ====== ====== ADOdb_Session::config ======
 +~~NOTOC~~
 <WRAP right box> <WRAP right box>
 ==Syntax== ==Syntax==
Line 17: Line 17:
   - A connection to a different database but in the same rdbms   - A connection to a different database but in the same rdbms
   - A connection entirely separate from an existing ADOdb connection   - A connection entirely separate from an existing ADOdb connection
 +
 +The method should be called **//before//** the PHP command [[http://php.net/manual/en/function.session-start.php|session_start]]. It must be defined in every procedure that accesses session variables.
 +
 +===== Parameters =====
 +==== $driver ====
 +The ADOdb driver to be used when establishing the connection, or optionally a DSN style configuration string with all of the necessary information required to establish a connection
 +==== $host ====
 +The host name to use
 +==== $user ====
 +The user name to use
 +==== $password ====
 +The password to use
 +==== $database ====
 +The database to connect to
 +==== $options ====
 +An optional array of configuration parameters. A list of parameters is defined [[|here]].
 +
 +===== Usage =====
 +<code php>
 +
 +include_once 'adodb/adodb.inc.php';
 +include_once "adodb/session/adodb-session2.php";
 +
 +$driver = 'mysqli';
 +$host = '127.0.0.1';
 +$user = 'user';
 +$pass = 'pass';
 +$database = 'adodb-sess';
 +
 +ADODB_Session::config($driver,$host,$user,$pass,$database);
 +
 +session_start();
 +
 +$_SESSION['page'] = 'page1';
 +</code>
v5/session/reference/config.1463353141.txt.gz · Last modified: 2017/04/21 11:38 (external edit)