ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:database:text

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
database:text [2015/10/14 03:54] mnewnhamv5:database:text [2016/01/13 01:53] – ↷ Page moved from database:text to v5:database:text mnewnham
Line 1: Line 1:
 ====== Plain Text ====== ====== Plain Text ======
 +<WRAP alert>
 +This driver is broken in ADOdb version 5 when used with PHP version 5.3 and up. This is due to the fact that the **execute** method has a non-compliant 3rd argument to it. Absent any user requests, this driver will be removed in ADOdb version 6.
 +</WRAP> 
 ===== Description ===== ===== Description =====
-The ''text'' driver allows an array of data to be processed like a read-only database table. The connect statement provides the data, as well as information about columns and names. No meta functions are supported.+The ''text'' driver allows an array of data to be processed like a read-only database table. The connect statement provides the data, as well as information about columns and names. No meta functions are supported. The *WHERE* SQL statement is ignored. In order to filter requests, An eval'd expression must be passed as a third argument
 ------------------- -------------------
 <WRAP right box 400px> <WRAP right box 400px>
Line 63: Line 66:
 --------------------- ---------------------
 <code php> <code php>
-$rs = $db->Execute('select * from table',false,"\$COL1='abc' and $\COL2=3");+$rs = $db->Execute('select * from table',false,"\$COL1='abc' and \$COL2=3");
  
 /* /*
Line 80: Line 83:
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
-$db = NewADOConnection('text');+include 'adodb/adodb.inc.php'; 
 + 
 +$data =  
 +array(0=>Array(10001,'1953-09-02','Georgi','Facello','M','1986-06-26'), 
 +      1=>Array(10002,'1964-06-02','Bezalel','Simmel','F','1985-11-21'), 
 +      2=>Array(10003,'1959-12-03','Parto','Bamford','M','1986-08-28'), 
 +      3=>Array(10004,'1954-05-01','Chirstian','Koblick','M','1986-12-01'), 
 +      4=>Array(10005,'1955-01-21','Kyoichi','Maliniak', 'M','1989-09-12'), 
 +      5=>Array(10006,'1953-04-20','Anneke','Preusig','F','1989-06-02'
 +); 
 + 
 +$cols      = array('EMPNO','BIRTH_DATE','FIRST_NAME','LAST_NAME','HIRE_DATE'); 
 +$metaTypes = array('I','D','C','C','C','D'); 
 + 
 +$db = ADOnewConnection('text'); 
 + 
 + 
 +$db->connect($data,$cols,$metaTypes); 
 + 
 +$sql = 'select * from table'; 
 + 
 +$result = $db->execute($sql,"\$EMPNO=10005"); 
 + 
 +while ($r = $result->fetchRow()) 
 +  print_r($r);
  
 </code> </code>
v5/database/text.txt · Last modified: 2020/01/13 13:17 by dregad