本文整理汇总了PHP中ADORecordSet类的典型用法代码示例。如果您正苦于以下问题:PHP ADORecordSet类的具体用法?PHP ADORecordSet怎么用?PHP ADORecordSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ADORecordSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: DBTimeStamp
function DBTimeStamp($ts)
{
if (is_string($ts)) {
$d = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
}
开发者ID:OberjukhtinIA0VWV0Allokuum,项目名称:testmasteke.leo,代码行数:7,代码来源:adodb-oracle.inc.php
示例2: DBTimeStamp
function DBTimeStamp($ts)
{
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
if (is_object($ts)) $ds = $ts->format($this->fmtDate);
else $ds = adodb_date($this->fmtTimeStamp,$ts);
return 'TO_DATE('.$ds.",'RRRR-MM-DD, HH:MI:SS AM')";
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:8,代码来源:adodb-oracle.inc.php
示例3: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . date($this->fmtTimeStamp, $ts) . ",'RRRR-MM-DD, HH:MI:SS AM')";
}
开发者ID:qoire,项目名称:portal,代码行数:10,代码来源:adodb-oci8.inc.php
示例4: _getObjectsFromResult
/**
* @param ADORecordSet $rs
* @return Model_WebapiKey[]
*/
private static function _getObjectsFromResult($rs)
{
$objects = array();
while (!$rs->EOF) {
$object = new Model_WebapiKey();
$object->id = intval($rs->fields['id']);
$object->nickname = $rs->fields['nickname'];
$object->access_key = $rs->fields['access_key'];
$object->secret_key = $rs->fields['secret_key'];
$rights = $rs->fields['rights'];
if (!empty($rights)) {
@($object->rights = unserialize($rights));
}
$objects[$object->id] = $object;
$rs->MoveNext();
}
return $objects;
}
开发者ID:sluther,项目名称:portsensor,代码行数:22,代码来源:Rest.php
示例5:
function &GetRowAssoc($upper = true)
{
if ($this->fetchMode == PGSQL_ASSOC && !$upper) {
return $this->fields;
}
$row =& ADORecordSet::GetRowAssoc($upper);
return $row;
}
开发者ID:dasatti,项目名称:dashboard,代码行数:8,代码来源:adodb-postgres64.inc.php
示例6: GetRowAssoc
function GetRowAssoc($upper = true)
{
if ($this->fetchMode == MYSQL_ASSOC && !$upper) {
$row = $this->fields;
} else {
$row = ADORecordSet::GetRowAssoc($upper);
}
return $row;
}
开发者ID:JonsonChang,项目名称:mail_tracker,代码行数:9,代码来源:adodb-mysql.inc.php
示例7: db_fetch_array
/**
* Retrieve the next row returned from a specific database query
* @param bool|ADORecordSet $p_result Database Query Record Set to retrieve next result for.
* @return array Database result
*/
function db_fetch_array(&$p_result)
{
global $g_db, $g_db_type;
if ($p_result->EOF) {
return false;
}
# mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this
if ($g_db_type == 'mysql' || $g_db_type == 'odbc_mssql' || $g_db_type == 'mssqlnative') {
$t_array = $p_result->fields;
$p_result->MoveNext();
return $t_array;
} else {
$t_row = $p_result->GetRowAssoc(false);
static $t_array_result;
static $t_array_fields;
if ($t_array_result != $p_result) {
// new query
$t_array_result = $p_result;
$t_array_fields = null;
} else {
if ($t_array_fields === null) {
$p_result->MoveNext();
return $t_row;
}
}
$t_convert = false;
$t_fieldcount = $p_result->FieldCount();
for ($i = 0; $i < $t_fieldcount; $i++) {
if (isset($t_array_fields[$i])) {
$t_field = $t_array_fields[$i];
} else {
$t_field = $p_result->FetchField($i);
$t_array_fields[$i] = $t_field;
}
switch ($t_field->type) {
case 'bool':
switch ($t_row[$t_field->name]) {
case 'f':
$t_row[$t_field->name] = false;
break;
case 't':
$t_row[$t_field->name] = true;
break;
}
$t_convert = true;
break;
default:
break;
}
}
if ($t_convert == false) {
$t_array_fields = null;
}
$p_result->MoveNext();
return $t_row;
}
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:62,代码来源:database_api.php
示例8: _getObjectsFromResult
/**
* @param ADORecordSet $rs
* @return Model_WatcherMailFilter[]
*/
private static function _getObjectsFromResult($rs)
{
$objects = array();
while (!$rs->EOF) {
$object = new Model_WatcherMailFilter();
$object->id = $rs->fields['id'];
$object->pos = $rs->fields['pos'];
$object->name = $rs->fields['name'];
$object->created = $rs->fields['created'];
$object->is_disabled = intval($rs->fields['is_disabled']);
$object->worker_id = intval($rs->fields['worker_id']);
if (null != @($criteria_ser = $rs->fields['criteria_ser'])) {
if (false === @($object->criteria = unserialize($criteria_ser))) {
$object->criteria = array();
}
}
if (null != @($actions_ser = $rs->fields['actions_ser'])) {
if (false === ($object->actions = unserialize($actions_ser))) {
$object->actions = array();
}
}
$objects[$object->id] = $object;
$rs->MoveNext();
}
return $objects;
}
开发者ID:Hildy,项目名称:cerb5,代码行数:30,代码来源:App.php
示例9: _getObjectsFromResultSet
private static function _getObjectsFromResultSet(ADORecordSet $rs)
{
$objects = array();
while (!$rs->EOF) {
$tag = new CloudGlueTag();
$tag->id = intval($rs->fields['id']);
$tag->name = $rs->fields['name'];
$objects[$tag->id] = $tag;
$rs->MoveNext();
}
return $objects;
}
开发者ID:sluther,项目名称:portsensor,代码行数:12,代码来源:DAO.php
示例10: GetRowAssoc
public function GetRowAssoc($upper = true)
{
if ($this->fetchMode == MYSQLI_ASSOC && !$upper) {
return $this->fields;
}
$row = ADORecordSet::GetRowAssoc($upper);
return $row;
}
开发者ID:bermi,项目名称:akelos,代码行数:8,代码来源:adodb-mysqli.inc.php
示例11: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
// See #8387 for more details
// original: return 'TO_DATE('.adodb_date($this->fmtTimeStamp,$ts).",'YYYY-MM-DD HH24:MI:SS')";
return adodb_date($this->fmtTimeStamp, $ts);
}
开发者ID:jin255ff,项目名称:company_website,代码行数:12,代码来源:adodb-db2.inc.php
示例12: testdb
//.........这里部分代码省略.........
$fld = $rs->FetchField($i);
print "<br> Field name is " . $fld->name;
print " " . $rs->Fields($fld->name);
}
}
print "<p>NUM TEST 2<br>";
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
$rs = $db->query('select * from adoxyz order by id');
for ($i = 0; $i < $rs->FieldCount(); $i++) {
$fld = $rs->FetchField($i);
print "<br> Field name is " . $fld->name;
print " " . $rs->Fields($fld->name);
}
print "<p>ASSOC Test of SelectLimit<br>";
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $db->selectlimit('select * from adoxyz order by id', 3, 4);
$cnt = 0;
while ($rs && !$rs->EOF) {
$cnt += 1;
if (!isset($rs->fields['firstname'])) {
print "<br><b>ASSOC returned numeric field</b></p>";
break;
}
$rs->MoveNext();
}
if ($cnt != 3) {
print "<br><b>Count should be 3, instead it was {$cnt}</b></p>";
}
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
if ($db->sysDate) {
$saved = $db->debug;
$db->debug = 1;
$rs = $db->Execute("select {$db->sysDate} from adoxyz where id=1");
if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
} else {
print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
}
print_r($rs->FetchField(0));
print time();
$db->debug = $saved;
} else {
print "<p><b>\$db->sysDate not defined</b></p>";
}
print "<p>Test CSV</p>";
include_once '../toexport.inc.php';
//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $db->SelectLimit('select id,firstname,lastname,created,\'The "young man", he said\' from adoxyz', 10);
print "<pre>";
print rs2csv($rs);
print "</pre>";
$rs = $db->SelectLimit('select id,firstname,lastname,created,\'The "young man", he said\' from adoxyz', 10);
print "<pre>";
rs2tabout($rs);
print "</pre>";
//print " CacheFlush ";
//$db->CacheFlush();
$date = $db->SQLDate('d-m-Y-\\QQ');
$sql = "SELECT {$date} from ADOXYZ";
print "<p>Test SQLDate: " . htmlspecialchars($sql) . "</p>";
$rs = $db->SelectLimit($sql, 1);
$d = date('d-m-Y-') . 'Q' . ceil(date('m') / 3.0);
if ($d != $rs->fields[0]) {
Err("SQLDate failed expected: {$d}, sql:" . $rs->fields[0]);
}
print "<p>Test Filter</p>";
开发者ID:alexpagnoni,项目名称:adodb,代码行数:67,代码来源:test.php
示例13: testdb
//.........这里部分代码省略.........
$fld = $rs->FetchField($i);
print "<br> Field name is " . $fld->name;
print " " . $rs->Fields($fld->name);
}
}
print "<p>NUM TEST 2<br>";
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
$rs = $db->query('select * from ADOXYZ order by id');
for ($i = 0; $i < $rs->FieldCount(); $i++) {
$fld = $rs->FetchField($i);
print "<br> Field name is " . $fld->name;
print " " . $rs->Fields($fld->name);
}
print "<p>ASSOC Test of SelectLimit<br>";
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $db->selectlimit('select * from ADOXYZ order by id', 3, 4);
$cnt = 0;
while ($rs && !$rs->EOF) {
$cnt += 1;
if (!isset($rs->fields['firstname'])) {
print "<br><b>ASSOC returned numeric field</b></p>";
break;
}
$rs->MoveNext();
}
if ($cnt != 3) {
print "<br><b>Count should be 3, instead it was {$cnt}</b></p>";
}
$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
if ($db->sysDate) {
$saved = $db->debug;
$db->debug = 1;
$rs = $db->Execute("select {$db->sysDate} from ADOXYZ where id=1");
if (ADORecordSet::UnixDate(date('Y-m-d')) != $rs->UnixDate($rs->fields[0])) {
print "<p><b>Invalid date {$rs->fields[0]}</b></p>";
} else {
print "<p>Passed \$sysDate test ({$rs->fields[0]})</p>";
}
print_r($rs->FetchField(0));
print time();
$db->debug = $saved;
} else {
print "<p><b>\$db->sysDate not defined</b></p>";
}
print "<p>Test CSV</p>";
include_once '../toexport.inc.php';
//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $db->SelectLimit('select id,firstname,lastname,created,\'He, he\' he,\'"\' q from ADOXYZ', 10);
print "<pre>";
print rs2csv($rs);
print "</pre>";
$rs = $db->SelectLimit('select id,firstname,lastname,created,\'The "young man", he said\' from ADOXYZ', 10);
if (PHP_VERSION < 5) {
print "<pre>";
rs2tabout($rs);
print "</pre>";
}
#print " CacheFlush ";
#$db->CacheFlush();
$date = $db->SQLDate('d-m-M-Y-\\QQ h:i:s A');
$sql = "SELECT {$date} from ADOXYZ";
print "<p>Test SQLDate: " . htmlspecialchars($sql) . "</p>";
$rs = $db->SelectLimit($sql, 1);
$d = date('d-m-M-Y-') . 'Q' . ceil(date('m') / 3.0) . date(' h:i:s A');
if (!$rs) {
Err("SQLDate query returned no recordset");
开发者ID:mvpphet,项目名称:IntranetPaper,代码行数:67,代码来源:test.php
示例14: GetRowAssoc
function GetRowAssoc($upper = ADODB_ASSOC_CASE)
{
if ($this->fetchMode == MYSQL_ASSOC && $upper == ADODB_ASSOC_CASE_LOWER) {
$row = $this->fields;
} else {
$row = ADORecordSet::GetRowAssoc($upper);
}
return $row;
}
开发者ID:kainabel,项目名称:freech,代码行数:9,代码来源:adodb-mysql.inc.php
示例15: getVariableArrayFromRecordSet
/**
* Converts a ADORecordSet object into an array of "rows" that
* are subarrays of variable => value pairs.
*
* @param ADORecordSet $dbRecordSet Anything ADOConnection::Execute() can return
* @return array
*/
protected function getVariableArrayFromRecordSet(ADORecordSet $dbRecordSet, $strResultForm)
{
$arResult = array();
switch ($strResultForm) {
case 'construct':
$arResultVars = $this->query->getConstructPatternVariables();
break;
default:
$arResultVars = $this->query->getResultVars();
break;
}
if (in_array('*', $arResultVars)) {
$arResultVars = array_keys($this->sg->arVarAssignments);
}
//work around bug in adodb:
// ADORecordSet_empty does not implement php5 iterators
if ($dbRecordSet->RowCount() <= 0) {
return array();
}
foreach ($dbRecordSet as $row) {
$arResultRow = array();
foreach ($arResultVars as $strVar) {
$strVarName = (string) $strVar;
if (!isset($this->sg->arVarAssignments[$strVarName])) {
//variable is in select, but not in result (test: q-select-2)
$arResultRow[$strVarName] = '';
} else {
$arVarSettings = $this->sg->arVarAssignments[$strVarName];
$strMethod = $this->arCreationMethods[$arVarSettings[1]];
$arResultRow[$strVarName] = $this->{$strMethod}($dbRecordSet, $arVarSettings[0], $strVar);
}
}
$arResult[] = $arResultRow;
}
return $arResult;
}
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:43,代码来源:Default.php
示例16: DBTimeStamp
function DBTimeStamp($ts, $isfld = false)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if ($isfld) {
return 'TO_DATE(substr(' . $ts . ",1,19),'RRRR-MM-DD, HH24:MI:SS')";
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . adodb_date("'Y-m-d H:i:s'", $ts) . ",'RRRR-MM-DD, HH24:MI:SS')";
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:adodb-oci8.inc.php
示例17: MetaType
function MetaType($t, $len = -1, $fieldobj = false)
{
return ADORecordSet::MetaType($t, $len, $fieldobj);
}
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:4,代码来源:adodb-datadict.inc.php
示例18: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) {
return 'null';
}
if (is_string($ts)) {
$ts = ADORecordSet::UnixTimeStamp($ts);
}
return 'TO_DATE(' . adodb_date($this->fmtTimeStamp, $ts) . ",'YYYY-MM-DD HH24:MI:SS')";
}
开发者ID:rowlandm,项目名称:uiexperiment,代码行数:10,代码来源:adodb-db2.inc.php
示例19: DBTimeStamp
function DBTimeStamp($ts)
{
if (empty($ts) && $ts !== 0) return 'null';
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
return 'TO_DATE('.adodb_date("'Y-m-d H:i:s'",$ts).",'RRRR-MM-DD, HH24:MI:SS')";
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:6,代码来源:adodb-oci8.old.inc.php
示例20:
function &GetArray($nRows = -1)
{
if ($nRows == -1 && $this->_currentRow <= 0 && !$this->_skiprow1) {
return $this->_array;
} else {
$arr =& ADORecordSet::GetArray($nRows);
return $arr;
}
}
开发者ID:dasatti,项目名称:dashboard,代码行数:9,代码来源:adodb.inc.php
注:本文中的ADORecordSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论