ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:session:session_index

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
v5:session:session_index [2016/05/22 17:21] mnewnhamv5:session:session_index [2018/07/24 00:21] – [MySQL] mnewnham
Line 87: Line 87:
  
 ADOdb_Session::config($driver, $host, $user, $password, $database, $options=false); ADOdb_Session::config($driver, $host, $user, $password, $database, $options=false);
-ADOdb_session::Persist($connectMode=false);+ADOdb_Session::persist($connectMode=false);
 session_start(); session_start();
  
Line 137: Line 137:
 Create this table in your database.  Create this table in your database. 
  
-==== MySQL ====+==== MySQL or PDO MySQL ====
      
   CREATE TABLE sessions2(   CREATE TABLE sessions2(
    sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',    sesskey VARCHAR( 64 ) NOT NULL DEFAULT '',
-    expiry DATETIME NOT NULL ,+   expiry DATETIME NOT NULL ,
    expireref VARCHAR( 250 ) DEFAULT '',    expireref VARCHAR( 250 ) DEFAULT '',
    created DATETIME NOT NULL ,    created DATETIME NOT NULL ,
Line 218: Line 218:
  $user = $ADODB_SESS_CONN->qstr($expireref);  $user = $ADODB_SESS_CONN->qstr($expireref);
  
- $ADODB_SESS_CONN->Execute("delete from shopping_cart where user=$user");+ $ADODB_SESS_CONN->execute("delete from shopping_cart where user=$user");
  system("rm /work/tmpfiles/$expireref/*");  system("rm /work/tmpfiles/$expireref/*");
 } }
Line 259: Line 259:
  
  
-===== Vacuum/Optimize Database ===== 
  
-During session garbage collection, if postgresql is detected, ADOdb can be set to run VACUUM. If mysql is detected, then optimize database could be called.You can turn this on or off using: +===== Backwards Compatibility =====
-<code php> +
-$turnOn = true; # or false +
-ADODB_Session::optimize($turnOn); +
-</code> +
-The default is optimization is disabled. +
- +
-===== Backwards Compatability =====+
  
 The older method of connecting to ADOdb using global variables is now deprecated, and **will be removed** in ADOdb version 6.0: The older method of connecting to ADOdb using global variables is now deprecated, and **will be removed** in ADOdb version 6.0:
v5/session/session_index.txt · Last modified: 2023/04/08 18:08 by dregad