Documentation TYPO3 par Ameos |
Public Member Functions | |
ADODB_odbtp () | |
ServerInfo () | |
ErrorMsg () | |
ErrorNo () | |
_insertid () | |
_affectedrows () | |
CreateSequence ($seqname='adodbseq', $start=1) | |
DropSequence ($seqname) | |
GenID ($seq='adodbseq', $start=1) | |
_connect ($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='') | |
_pconnect ($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='') | |
SelectDB ($dbName) | |
& | MetaTables ($ttype='', $showSchema=false, $mask=false) |
& | MetaColumns ($table, $upper=true) |
& | MetaPrimaryKeys ($table, $owner='') |
& | MetaForeignKeys ($table, $owner='', $upper=false) |
BeginTrans () | |
CommitTrans ($ok=true) | |
RollbackTrans () | |
& | SelectLimit ($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0) |
Prepare ($sql) | |
PrepareSP ($sql) | |
Parameter (&$stmt, &$var, $name, $isOutput=false, $maxLen=0, $type=0) | |
UpdateBlob ($table, $column, $val, $where, $blobtype='image') | |
IfNull ($field, $ifNull) | |
_query ($sql, $inputarr=false) | |
_close () | |
Public Attributes | |
$databaseType = "odbtp" | |
$dataProvider = "odbtp" | |
$fmtDate = "'Y-m-d'" | |
uppercase function | |
$fmtTimeStamp = "'Y-m-d, h:i:sA'" | |
used by DBDate() as the default date format used by the database | |
$replaceQuote = "''" | |
string that represents FALSE for a database | |
$odbc_driver = 0 | |
$hasAffectedRows = true | |
supports autoincrement ID? | |
$hasInsertID = false | |
$hasGenID = true | |
has ability to run MoveFirst(), scrolling backwards | |
$hasMoveFirst = true | |
this is a readonly database - used by phpLens | |
$_genSeqSQL = "create table %s (seq_name char(30) not null unique , seq_value integer not null)" | |
$_dropSeqSQL = "delete from adodb_seq where seq_name = '%s'" | |
$_bindInputArray = false | |
A boolean variable to state whether its a persistent connection or normal connection. */. | |
$_useUnicodeSQL = false | |
$_canPrepareSP = false | |
$_dontPoolDBC = true |
Definition at line 17 of file adodb-odbtp.inc.php.
ADODB_odbtp::ServerInfo | ( | ) |
Get server version info...
Reimplemented from ADOConnection.
Definition at line 40 of file adodb-odbtp.inc.php.
ADODB_odbtp::ErrorMsg | ( | ) |
Reimplemented from ADOConnection.
Definition at line 46 of file adodb-odbtp.inc.php.
Referenced by _connect().
ADODB_odbtp::ErrorNo | ( | ) |
Reimplemented from ADOConnection.
Definition at line 52 of file adodb-odbtp.inc.php.
ADODB_odbtp::GenID | ( | $ | seq = 'adodbseq' , |
|
$ | start = 1 | |||
) |
Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;
seqname | name of sequence to use | |
startID | if sequence does not exist, start at this ID |
Reimplemented from ADOConnection.
Definition at line 106 of file adodb-odbtp.inc.php.
References ADOConnection::Execute(), and ADOConnection::GetOne().
ADODB_odbtp::SelectDB | ( | $ | dbName | ) |
Choose a database to connect to. Many databases do not support this.
dbName | is the name of the database to select |
Reimplemented from ADOConnection.
Definition at line 264 of file adodb-odbtp.inc.php.
& ADODB_odbtp::MetaTables | ( | $ | ttype = '' , |
|
$ | showSchema = false , |
|||
$ | mask = false | |||
) |
ttype | can either be 'VIEW' or 'TABLE' or false. If false, both views and tables are returned. "VIEW" returns only views "TABLE" returns only tables | |
showSchema | returns the schema/user with the table name, eg. USER.TABLE | |
mask | is the input mask - only supported by oci8 and postgresql |
Reimplemented from ADOConnection.
Definition at line 274 of file adodb-odbtp.inc.php.
References ADOConnection::GetArray(), and ADOConnection::SetFetchMode().
& ADODB_odbtp::MetaColumns | ( | $ | table, | |
$ | upper = true | |||
) |
List columns in a database as an array of ADOFieldObjects. See top of file for definition of object.
$table | table name to query | |
$normalize | makes table name case-insensitive (required by some databases) is optional database schema to use - not supported by all databases. |
Reimplemented from ADOConnection.
Definition at line 296 of file adodb-odbtp.inc.php.
References ADOConnection::$false, ADOConnection::_findschema(), ADOConnection::Execute(), and ADOConnection::SetFetchMode().
& ADODB_odbtp::MetaPrimaryKeys | ( | $ | table, | |
$ | owner = '' | |||
) |
Reimplemented from ADOConnection.
Definition at line 341 of file adodb-odbtp.inc.php.
References ADOConnection::GetArray().
& ADODB_odbtp::MetaForeignKeys | ( | $ | table, | |
$ | owner = '' , |
|||
$ | upper = false | |||
) |
Reimplemented from ADOConnection.
Definition at line 358 of file adodb-odbtp.inc.php.
References ADOConnection::$false, and ADOConnection::GetArray().
ADODB_odbtp::BeginTrans | ( | ) |
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().
Reimplemented from ADOConnection.
Definition at line 388 of file adodb-odbtp.inc.php.
ADODB_odbtp::CommitTrans | ( | $ | ok = true |
) |
If database does not support transactions, always return true as data always commited
$ok | set to false to rollback transaction, true to commit |
Reimplemented from ADOConnection.
Definition at line 403 of file adodb-odbtp.inc.php.
References RollbackTrans().
ADODB_odbtp::RollbackTrans | ( | ) |
If database does not support transactions, rollbacks always fail, so return false
Reimplemented from ADOConnection.
Definition at line 414 of file adodb-odbtp.inc.php.
Referenced by CommitTrans().
& ADODB_odbtp::SelectLimit | ( | $ | sql, | |
$ | nrows = -1 , |
|||
$ | offset = -1 , |
|||
$ | inputarr = false , |
|||
$ | secs2cache = 0 | |||
) |
Will select, getting rows from $offset (1-based), for $nrows. This simulates the MySQL "select * from table limit $offset,$nrows" , and the PostgreSQL "select * from table limit $nrows offset $offset". Note that MySQL and PostgreSQL parameter ordering is the opposite of the other. eg. SelectLimit('select * from table',3); will return rows 1 to 3 (1-based) SelectLimit('select * from table',3,2); will return rows 3 to 5 (1-based)
Uses SELECT TOP for Microsoft databases (when $this->hasTop is set) BUG: Currently SelectLimit fails with $sql with LIMIT or TOP clause already set
sql | ||
[offset] | is the row to start calculations from (1-based) | |
[nrows] | is the number of rows to get | |
[inputarr] | array of bind variables | |
[secs2cache] | is a private parameter only used by jlim |
Reimplemented from ADOConnection.
Definition at line 424 of file adodb-odbtp.inc.php.
References ADOConnection::SelectLimit().
ADODB_odbtp::Prepare | ( | $ | sql | ) |
Should prepare the sql statement and return the stmt resource. For databases that do not support this, we return the $sql. To ensure compatibility with databases that do not support prepare:
$stmt = $db->Prepare("insert into table (id, name) values (?,?)"); $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); $db->Execute($stmt,array(2,'Joe')) or die('insert failed');
sql | SQL to send to database |
Reimplemented from ADOConnection.
Definition at line 434 of file adodb-odbtp.inc.php.
ADODB_odbtp::UpdateBlob | ( | $ | table, | |
$ | column, | |||
$ | val, | |||
$ | where, | |||
$ | blobtype = 'image' | |||
) |
Update a blob column, given a where clause. There are more sophisticated blob handling functions that we could have implemented, but all require a very complex API. Instead we have chosen something that is extremely simple to understand and use.
Note: $blobtype supports 'BLOB' and 'CLOB', default is BLOB of course.
Usage to update a $blobvalue which has a primary key blob_id=1 into a field blobtable.blobcolumn:
UpdateBlob('blobtable', 'blobcolumn', $blobvalue, 'blob_id=1');
Insert example:
$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
Reimplemented from ADOConnection.
Definition at line 499 of file adodb-odbtp.inc.php.