Documentation TYPO3 par Ameos

adodb-sqlitepo.inc.php

00001 <?php
00002 /*
00003 V4.93 10 Oct 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
00004   Released under both BSD license and Lesser GPL library license.
00005   Whenever there is any discrepancy between the two licenses,
00006   the BSD license will take precedence.
00007 
00008   Portable version of sqlite driver, to make it more similar to other database drivers.
00009   The main differences are
00010 
00011    1. When selecting (joining) multiple tables, in assoc mode the table
00012           names are included in the assoc keys in the "sqlite" driver.
00013           
00014           In "sqlitepo" driver, the table names are stripped from the returned column names. 
00015           When this results in a conflict,  the first field get preference.
00016 
00017         Contributed by Herman Kuiper  herman#ozuzo.net  
00018 */
00019 
00020 if (!defined('ADODB_DIR')) die();
00021 
00022 include_once(ADODB_DIR.'/drivers/adodb-sqlite.inc.php');
00023 
00024 class ADODB_sqlitepo extends ADODB_sqlite {
00025    var $databaseType = 'sqlitepo';
00026 
00027    function ADODB_sqlitepo()
00028    {
00029       $this->ADODB_sqlite();
00030    }
00031 }
00032 
00033 /*--------------------------------------------------------------------------------------
00034        Class Name: Recordset
00035 --------------------------------------------------------------------------------------*/
00036 
00037 class ADORecordset_sqlitepo extends ADORecordset_sqlite {
00038 
00039    var $databaseType = 'sqlitepo';
00040 
00041    function ADORecordset_sqlitepo($queryID,$mode=false)
00042    {
00043       $this->ADORecordset_sqlite($queryID,$mode);
00044    }
00045    
00046    // Modified to strip table names from returned fields
00047    function _fetch($ignore_fields=false)
00048    {
00049       $this->fields = array();
00050       $fields = @sqlite_fetch_array($this->_queryID,$this->fetchMode);
00051       if(is_array($fields))
00052          foreach($fields as $n => $v)
00053          {
00054             if(($p = strpos($n, ".")) !== false)
00055                $n = substr($n, $p+1);
00056             $this->fields[$n] = $v;
00057          }
00058 
00059       return !empty($this->fields);
00060    }
00061 }
00062 ?>


Généré par L'expert TYPO3 avec  doxygen 1.4.6