當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JDatabase::loadResultArray方法代碼示例

本文整理匯總了PHP中JDatabase::loadResultArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabase::loadResultArray方法的具體用法?PHP JDatabase::loadResultArray怎麽用?PHP JDatabase::loadResultArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JDatabase的用法示例。


在下文中一共展示了JDatabase::loadResultArray方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _anynomousAllowed

 protected function _anynomousAllowed()
 {
     $result = array();
     $query = "SELECT id\n\t\t\t\t\t\t\tFROM #__kunena_categories\n\t\t\t\t\t\t\tWHERE allow_anonymous=1;";
     $this->_db->setQuery($query);
     $allow_anonymous = $this->_db->loadResultArray();
     if ($this->_db->getErrorNum()) {
         $result = array('status' => '-1', 'error' => KunenaError::getDatabaseError());
     } else {
         $result['status'] = '1';
         $result['allowed_anonymous'] = $allow_anonymous;
     }
     return $result;
 }
開發者ID:vuchannguyen,項目名稱:hoctap,代碼行數:14,代碼來源:kunena.ajax.helper.php

示例2: jotcache_upgrade

function jotcache_upgrade(JDatabase $db)
{
    $message = '';
    $query = $db->getQuery(true);
    $query->select('COUNT(*)')->from('#__jotcache_exclude')->where('type=1');
    $tplex_count = $db->setQuery($query)->loadResult();
    if ($tplex_count == 0) {
        return false;
    }
    $query->clear('where');
    $query->where('type=4');
    $count = $db->setQuery($query)->loadResult();
    if ($count == 0) {
        $query->clear('select')->clear('where');
        $query->select($db->quoteName('value'))->from($db->quoteName('#__template_styles', 's'))->where('name=s.id')->where('type=1')->order('s.home');
        $defs = $db->setQuery($query)->loadResultArray();
        $positions = array();
        foreach ($defs as $def) {
            $def_array = unserialize($def);
            $positions = array_merge($positions, $def_array);
        }
        $query->clear();
        $query->select('position')->from('#__modules')->where('client_id = 0')->where('published = 1')->where('position <>' . $db->quote(''))->group('position')->order('position');
        $db->setQuery($query);
        $items = $db->loadResultArray();
        $cleaned_positions = array();
        foreach ($items as $item) {
            if (array_key_exists($item, $positions)) {
                $cleaned_positions[$item] = $positions[$item];
            }
        }
        $defs = serialize($cleaned_positions);
        $query->clear();
        $query->insert('#__jotcache_exclude')->columns('name,value,type')->values('1,' . $db->quote($defs) . ',4');
        if ($db->setQuery($query)->query()) {
            $message = "TABLE #__jotcache_exclude has been upgraded. Check JotCache TPL exclude definitions for correct values.";
        } else {
            JError::raiseNotice(100, $db->getErrorMsg());
        }
        return $message;
    }
}
開發者ID:alesconti,項目名稱:FF_2015,代碼行數:42,代碼來源:install.php

示例3: loadResultArray

 /**
  * Load an array of single field results into an array
  */
 function loadResultArray($numinarray = 0)
 {
     if (checkJversion() >= 2) {
         $result = $this->_db->loadColumn($numinarray);
     } else {
         $result = $this->_db->loadResultArray($numinarray);
     }
     return $this->_nullToArray($result);
 }
開發者ID:rogatnev-nikita,項目名稱:cloudinterpreter,代碼行數:12,代碼來源:cb.database.php


注:本文中的JDatabase::loadResultArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。