phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forums:   PHPLens Technical Support:   Replies 
New ReplySearch
Topic: AdoDB PHP 5.17
author: Loris Luise   created: 23-06-2012 11:18:27 AM
Hello , switching form v 5.14 to 5.17 , something has broken.

A simple query like this


$sql = "SELECT * FROM USERS WHERE DN_UID = 1 and DN_CID = 22646";
$rs = $conn->execute($sql);

if($rs->recordcount() > 0){
$result['nLivello'] = $arr[0]['DN_LIVELLO'];
$result['lMediaRelation'] = $arr[0]['DB_MR'];
$result['lContentAnalysis'] = $arr[0]['DB_CA'];
$result['use_internal_pdfviewer'] = $arr[0]['DB_INTERNAL_PDFVIEWER'];
$result['use_docsdownload_inline'] = $arr[0]['DB_DOCSDOWNLOAD_INLINE'];
}

is no more working correctly because fields
DB_INTERNAL_PDFVIEWER and DB_DOCSDOWNLOAD_INLINE (last 2 fields of te table) is not returned.

I'm using ibase/firebird driver with FIREBIRD 2.5 engine db.
I'm using also $ADODB_FETCH_MODE = 3;

with version 5.14 all is ok, 5.17 not.

What is wrong?

Thanks
Topic: Re:AdoDB PHP 5.17
author: John Lim   created: 26-06-2012 06:13:23 AM
I just did a diff of 5.14 and 5.17 for firebird and ibase drivers and there seems to be no change in source code. Perhaps you can try

print_r($arr[0]);

and see what the result is?
Topic: Re:AdoDB PHP 5.17
author: Loris Luise   created: 14-07-2012 09:53:52 AM
====================
Using ADODB 517
print_r RS
ADORecordSet_array Object ( [databaseType] => array [_array] => Array ( [0] => Array ( [0] => 22646 [1] => 1 [2] => vgi01 [3] => 0A686A93A3ED2011FF5938D97F20356073295F65 [4] => VGI 01 [5] => 2008-09-02 09:51:58 [6] => 1 [7] => 0 [8] => 2012-12-31 23:59:59 [9] => 3 [10] => 1043 [11] => 2012-07-06 10:01:07 [12] => [13] => 1 [14] => 0 [15] => 0 [16] => 0 [17] => [18] => [DN_CID] => 22646 [DN_UID] => 1 [DC_UTENTE] => vgi01 [DC_PASSWORD] => 0A686A93A3ED2011FF5938D97F20356073295F65 [DC_DESCRIZIONE] => VGI 01 [DD_CREAZIONE] => 2008-09-02 09:51:58 [DN_LIVELLO] => 1 [DB_CAMBIA_PROSSIMO_ACCESSO] => 0 [DD_SCADENZA] => 2012-12-31 23:59:59 [DN_SESSIONI_CONCESSE] => 3 [DN_ACCESSI] => 1043 [DD_ULTIMOACCESSO] => 2012-07-06 10:01:07 [DN_PREF_ORDINE] => 1 [DN_PREF_DIMENSIONE_PAGINA] => 0 [DB_MR] => 0 [DB_CA] => 0 ) ) [_types] => [_colnames] => [_skiprow1] => [_fieldobjects] => Array ( [0] => ADOFieldObject Object ( [name] => DN_CID [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [1] => ADOFieldObject Object ( [name] => DN_UID [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [2] => ADOFieldObject Object ( [name] => DC_UTENTE [max_length] => 128 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [3] => ADOFieldObject Object ( [name] => DC_PASSWORD [max_length] => 256 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [4] => ADOFieldObject Object ( [name] => DC_DESCRIZIONE [max_length] => 400 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [5] => ADOFieldObject Object ( [name] => DD_CREAZIONE [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [6] => ADOFieldObject Object ( [name] => DN_LIVELLO [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [7] => ADOFieldObject Object ( [name] => DB_CAMBIA_PROSSIMO_ACCESSO [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [8] => ADOFieldObject Object ( [name] => DD_SCADENZA [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [9] => ADOFieldObject Object ( [name] => DN_SESSIONI_CONCESSE [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [10] => ADOFieldObject Object ( [name] => DN_ACCESSI [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [11] => ADOFieldObject Object ( [name] => DD_ULTIMOACCESSO [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [12] => ADOFieldObject Object ( [name] => DD_VARIAZIONE [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [13] => ADOFieldObject Object ( [name] => DN_PREF_ORDINE [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [14] => ADOFieldObject Object ( [name] => DN_PREF_DIMENSIONE_PAGINA [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [15] => ADOFieldObject Object ( [name] => DB_MR [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [16] => ADOFieldObject Object ( [name] => DB_CA [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [17] => ADOFieldObject Object ( [name] => DB_INTERNAL_PDFVIEWER [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [18] => ADOFieldObject Object ( [name] => DB_DOCSDOWNLOAD_INLINE [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) ) [canSeek] => 1 [affectedrows] => [insertid] => [sql] => SELECT * FROM UTENTI WHERE DN_UID = 1 and DN_CID = 22646 [compat] => [dataProvider] => ibase [fields] => Array ( [0] => 22646 [1] => 1 [2] => vgi01 [3] => 0A686A93A3ED2011FF5938D97F20356073295F65 [4] => VGI 01 [5] => 2008-09-02 09:51:58 [6] => 1 [7] => 0 [8] => 2012-12-31 23:59:59 [9] => 3 [10] => 1043 [11] => 2012-07-06 10:01:07 [12] => [13] => 1 [14] => 0 [15] => 0 [16] => 0 [17] => [18] => [DN_CID] => 22646 [DN_UID] => 1 [DC_UTENTE] => vgi01 [DC_PASSWORD] => 0A686A93A3ED2011FF5938D97F20356073295F65 [DC_DESCRIZIONE] => VGI 01 [DD_CREAZIONE] => 2008-09-02 09:51:58 [DN_LIVELLO] => 1 [DB_CAMBIA_PROSSIMO_ACCESSO] => 0 [DD_SCADENZA] => 2012-12-31 23:59:59 [DN_SESSIONI_CONCESSE] => 3 [DN_ACCESSI] => 1043 [DD_ULTIMOACCESSO] => 2012-07-06 10:01:07 [DN_PREF_ORDINE] => 1 [DN_PREF_DIMENSIONE_PAGINA] => 0 [DB_MR] => 0 [DB_CA] => 0 ) [blobSize] => 100 [EOF] => [emptyTimeStamp] => [emptyDate] => [debug] => [timeCreated] => 0 [bind] => [fetchMode] => 3 [connection] => ADODB_firebird Object ( [databaseType] => firebird [dialect] => 3 [sysTimeStamp] => CURRENT_TIMESTAMP [dataProvider] => ibase [replaceQuote] => '' [ibase_datefmt] => %Y-%m-%d [fmtDate] => 'Y-m-d' [ibase_timestampfmt] => %Y-%m-%d %H:%M:%S [ibase_timefmt] => %H:%M:%S [fmtTimeStamp] => 'Y-m-d, H:i:s' [concat_operator] => || [_transactionID] => [metaTablesSQL] => select rdb$relation_name from rdb$relations where rdb$relation_name not like 'RDB$%' [metaColumnsSQL] => select a.rdb$field_name, a.rdb$null_flag, a.rdb$default_source, b.rdb$field_length, b.rdb$field_scale, b.rdb$field_sub_type, b.rdb$field_precision, b.rdb$field_type from rdb$relation_fields a, rdb$fields b where a.rdb$field_source = b.rdb$field_name and a.rdb$relation_name = '%s' order by a.rdb$field_position asc [ibasetrans] => 0 [hasGenID] => 1 [_bindInputArray] => 1 [buffers] => 0 [sysDate] => cast('TODAY' as timestamp) [ansiOuter] => 1 [hasAffectedRows] => [poorAffectedRows] => 1 [blobEncodeType] => C [role] => [database] => wpm3dev-utf8 [host] => 192.168.34.26 [user] => sysdba [password] => not stored [debug] => [maxblobsize] => 262144 [substr] => substr [length] => length [random] => rand() [upperCase] => upper [true] => 1 [false] => 0 [nameQuote] => " [charSet] => UTF8 [metaDatabasesSQL] => [uniqueOrderBy] => [emptyDate] => [emptyTimeStamp] => [lastInsID] => [hasInsertID] => [hasTop] => [hasLimit] => [readOnly] => [hasMoveFirst] => [hasTransactions] => 1 [genID] => 0 [raiseErrorFn] => [isoDates] => [cacheSecs] => 3600 [memCache] => [memCacheHost] => [memCachePort] => 11211 [memCacheCompress] => [sysUTimeStamp] => [arrayClass] => ADORecordSet_array [noNullStrings] => [numCacheHits] => 0 [numCacheMisses] => 0 [pageExecuteCountRows] => 1 [uniqueSort] => [leftOuter] => [rightOuter] => [autoRollback] => [fnExecute] => adodb_log_sql [fnCacheExecute] => [rsPrefix] => ADORecordSet_ [autoCommit] => 1 [transOff] => 0 [transCnt] => 0 [fetchMode] => 3 [null2null] => null [bulkBind] => [_oldRaiseFn] => [_transOK] => [_connectionID] => Resource id #22 [_errorMsg] => [_errorCode] => 0 [_queryID] => Resource id #26 [_isPersistentConnection] => 1 [_evalAll] => [_affected] => [_logsql] => 1 [_transmode] => [charset] => UTF8 ) [_numOfRows] => 1 [_numOfFields] => 19 [_queryID] => Resource id #26 [_currentRow] => 0 [_closed] => [_inited] => 1 [_obj] => [_names] => [_currentPage] => -1 [_atFirstPage] => [_atLastPage] => [_lastPageNo] => -1 [_maxRecordCount] => 0 [datetime] => )
Notice: Undefined index: DB_INTERNAL_PDFVIEWER in /usr/share/wpm3-dev/testado517.php on line 34 Notice: Undefined index: DB_DOCSDOWNLOAD_INLINE in /usr/share/wpm3-dev/testado517.php on line 35

====================
Using ADODB 514
print_r RS
ADORecordSet_array Object ( [databaseType] => array [_array] => Array ( [0] => Array ( [0] => 22646 [1] => 1 [2] => vgi01 [3] => 0A686A93A3ED2011FF5938D97F20356073295F65 [4] => VGI 01 [5] => 2008-09-02 09:51:58 [6] => 1 [7] => 0 [8] => 2012-12-31 23:59:59 [9] => 3 [10] => 1043 [11] => 2012-07-06 10:01:07 [12] => [13] => 1 [14] => 0 [15] => 0 [16] => 0 [17] => [18] => [DN_CID] => 22646 [DN_UID] => 1 [DC_UTENTE] => vgi01 [DC_PASSWORD] => 0A686A93A3ED2011FF5938D97F20356073295F65 [DC_DESCRIZIONE] => VGI 01 [DD_CREAZIONE] => 2008-09-02 09:51:58 [DN_LIVELLO] => 1 [DB_CAMBIA_PROSSIMO_ACCESSO] => 0 [DD_SCADENZA] => 2012-12-31 23:59:59 [DN_SESSIONI_CONCESSE] => 3 [DN_ACCESSI] => 1043 [DD_ULTIMOACCESSO] => 2012-07-06 10:01:07 [DD_VARIAZIONE] => [DN_PREF_ORDINE] => 1 [DN_PREF_DIMENSIONE_PAGINA] => 0 [DB_MR] => 0 [DB_CA] => 0 [DB_INTERNAL_PDFVIEWER] => [DB_DOCSDOWNLOAD_INLINE] => ) ) [_types] => [_colnames] => [_skiprow1] => [_fieldobjects] => Array ( [0] => ADOFieldObject Object ( [name] => DN_CID [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [1] => ADOFieldObject Object ( [name] => DN_UID [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [2] => ADOFieldObject Object ( [name] => DC_UTENTE [max_length] => 128 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [3] => ADOFieldObject Object ( [name] => DC_PASSWORD [max_length] => 256 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [4] => ADOFieldObject Object ( [name] => DC_DESCRIZIONE [max_length] => 400 [type] => VARCHAR [not_null] => [has_default] => [default_value] => null ) [5] => ADOFieldObject Object ( [name] => DD_CREAZIONE [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [6] => ADOFieldObject Object ( [name] => DN_LIVELLO [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [7] => ADOFieldObject Object ( [name] => DB_CAMBIA_PROSSIMO_ACCESSO [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [8] => ADOFieldObject Object ( [name] => DD_SCADENZA [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [9] => ADOFieldObject Object ( [name] => DN_SESSIONI_CONCESSE [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [10] => ADOFieldObject Object ( [name] => DN_ACCESSI [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [11] => ADOFieldObject Object ( [name] => DD_ULTIMOACCESSO [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [12] => ADOFieldObject Object ( [name] => DD_VARIAZIONE [max_length] => 8 [type] => TIMESTAMP [not_null] => [has_default] => [default_value] => null ) [13] => ADOFieldObject Object ( [name] => DN_PREF_ORDINE [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [14] => ADOFieldObject Object ( [name] => DN_PREF_DIMENSIONE_PAGINA [max_length] => 4 [type] => INTEGER [not_null] => [has_default] => [default_value] => null ) [15] => ADOFieldObject Object ( [name] => DB_MR [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [16] => ADOFieldObject Object ( [name] => DB_CA [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [17] => ADOFieldObject Object ( [name] => DB_INTERNAL_PDFVIEWER [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) [18] => ADOFieldObject Object ( [name] => DB_DOCSDOWNLOAD_INLINE [max_length] => 2 [type] => SMALLINT [not_null] => [has_default] => [default_value] => null ) ) [canSeek] => 1 [affectedrows] => [insertid] => [sql] => SELECT * FROM UTENTI WHERE DN_UID = 1 and DN_CID = 22646 [compat] => [dataProvider] => ibase [fields] => Array ( [0] => 22646 [1] => 1 [2] => vgi01 [3] => 0A686A93A3ED2011FF5938D97F20356073295F65 [4] => VGI 01 [5] => 2008-09-02 09:51:58 [6] => 1 [7] => 0 [8] => 2012-12-31 23:59:59 [9] => 3 [10] => 1043 [11] => 2012-07-06 10:01:07 [12] => [13] => 1 [14] => 0 [15] => 0 [16] => 0 [17] => [18] => [DN_CID] => 22646 [DN_UID] => 1 [DC_UTENTE] => vgi01 [DC_PASSWORD] => 0A686A93A3ED2011FF5938D97F20356073295F65 [DC_DESCRIZIONE] => VGI 01 [DD_CREAZIONE] => 2008-09-02 09:51:58 [DN_LIVELLO] => 1 [DB_CAMBIA_PROSSIMO_ACCESSO] => 0 [DD_SCADENZA] => 2012-12-31 23:59:59 [DN_SESSIONI_CONCESSE] => 3 [DN_ACCESSI] => 1043 [DD_ULTIMOACCESSO] => 2012-07-06 10:01:07 [DD_VARIAZIONE] => [DN_PREF_ORDINE] => 1 [DN_PREF_DIMENSIONE_PAGINA] => 0 [DB_MR] => 0 [DB_CA] => 0 [DB_INTERNAL_PDFVIEWER] => [DB_DOCSDOWNLOAD_INLINE] => ) [blobSize] => 100 [EOF] => [emptyTimeStamp] => [emptyDate] => [debug] => [timeCreated] => 0 [bind] => [fetchMode] => 3 [connection] => ADODB_firebird Object ( [databaseType] => firebird [dialect] => 3 [sysTimeStamp] => CURRENT_TIMESTAMP [dataProvider] => ibase [replaceQuote] => '' [ibase_datefmt] => %Y-%m-%d [fmtDate] => 'Y-m-d' [ibase_timestampfmt] => %Y-%m-%d %H:%M:%S [ibase_timefmt] => %H:%M:%S [fmtTimeStamp] => 'Y-m-d, H:i:s' [concat_operator] => || [_transactionID] => [metaTablesSQL] => select rdb$relation_name from rdb$relations where rdb$relation_name not like 'RDB$%' [metaColumnsSQL] => select a.rdb$field_name, a.rdb$null_flag, a.rdb$default_source, b.rdb$field_length, b.rdb$field_scale, b.rdb$field_sub_type, b.rdb$field_precision, b.rdb$field_type from rdb$relation_fields a, rdb$fields b where a.rdb$field_source = b.rdb$field_name and a.rdb$relation_name = '%s' order by a.rdb$field_position asc [ibasetrans] => 0 [hasGenID] => 1 [_bindInputArray] => 1 [buffers] => 0 [sysDate] => cast('TODAY' as timestamp) [ansiOuter] => 1 [hasAffectedRows] => [poorAffectedRows] => 1 [blobEncodeType] => C [role] => [database] => wpm3dev-utf8 [host] => 192.168.34.26 [user] => sysdba [password] => not stored [debug] => [maxblobsize] => 262144 [substr] => substr [length] => length [random] => rand() [upperCase] => upper [true] => 1 [false] => 0 [nameQuote] => " [charSet] => UTF8 [metaDatabasesSQL] => [uniqueOrderBy] => [emptyDate] => [emptyTimeStamp] => [lastInsID] => [hasInsertID] => [hasTop] => [hasLimit] => [readOnly] => [hasMoveFirst] => [hasTransactions] => 1 [genID] => 0 [raiseErrorFn] => [isoDates] => [cacheSecs] => 3600 [memCache] => [memCacheHost] => [memCachePort] => 11211 [memCacheCompress] => [sysUTimeStamp] => [arrayClass] => ADORecordSet_array [noNullStrings] => [numCacheHits] => 0 [numCacheMisses] => 0 [pageExecuteCountRows] => 1 [uniqueSort] => [leftOuter] => [rightOuter] => [autoRollback] => [fnExecute] => adodb_log_sql [fnCacheExecute] => [rsPrefix] => ADORecordSet_ [autoCommit] => 1 [transOff] => 0 [transCnt] => 0 [fetchMode] => 3 [null2null] => null [bulkBind] => [_oldRaiseFn] => [_transOK] => [_connectionID] => Resource id #22 [_errorMsg] => [_errorCode] => 0 [_queryID] => Resource id #26 [_isPersistentConnection] => 1 [_evalAll] => [_affected] => [_logsql] => 1 [_transmode] => [charset] => UTF8 ) [_numOfRows] => 1 [_numOfFields] => 19 [_queryID] => Resource id #26 [_currentRow] => 0 [_closed] => [_inited] => 1 [_obj] => [_names] => [_currentPage] => -1 [_atFirstPage] => [_atLastPage] => [_lastPageNo] => -1 [_maxRecordCount] => 0 [datetime] => )


Thanks.
Topic: Re:AdoDB PHP 5.17
author: John Lim   created: 14-08-2012 08:37:19 PM
Please change GetRowAssoc in adodb.inc.php to:

function GetRowAssoc($upper=1)
{
$record = array();
if (!$this->bind) {
$this->GetAssocKeys($upper);
}
foreach($this->bind as $k => $v) {
if( isset( $this->fields[$v] ) ) {
$record[$k] = $this->fields[$v];
} else if (isset($this->fields[$k])) {
$record[$k] = $this->fields[$k];
} else
$record[$k] = null; ### FIX
}
return $record;
}
Topic: Re:AdoDB PHP 5.17
author: Loris Luise   created: 21-08-2012 04:24:06 AM
Thanks a lot,
now it's working!
Topic: Re:AdoDB PHP 5.17
author: sajid   created: 18-01-2013 00:22:19 AM
ADOdb hides the differences between the different databases so developers can easily switch databases without changing code.ADOdb is used in lots of projects around the web and is almost considered a standard on its own.

Here are some key features of ADOdb:
Supported databases:
Page 1
New ReplySearch

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800