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


PHP JDatabase::nameQuote方法代碼示例

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


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

示例1: save

 /**
  * Generic save function
  *
  * @access	public
  * @param	array	Source array for binding to class vars
  * @param	string	Filter for the order updating
  * @param	mixed	An array or space separated list of fields not to bind
  * @returns TRUE if completely successful, FALSE if partially or not succesful.
  */
 function save($source, $order_filter = '', $ignore = '')
 {
     if (!$this->bind($source, $ignore)) {
         return false;
     }
     if (!$this->check()) {
         return false;
     }
     if (!$this->store()) {
         return false;
     }
     if (!$this->checkin()) {
         return false;
     }
     if ($order_filter) {
         $filter_value = $this->{$order_filter};
         $this->reorder($order_filter ? $this->_db->nameQuote($order_filter) . ' = ' . $this->_db->Quote($filter_value) : '');
     }
     $this->setError('');
     return true;
 }
開發者ID:hrishikesh-kumar,項目名稱:NBSNIP,代碼行數:30,代碼來源:table.php

示例2: _getAutoComplete

 protected function _getAutoComplete($do, $data)
 {
     $result = array();
     // only registered users when the board is online will endup here
     // Verify permissions
     if ($this->_session->allowed && $this->_session->allowed != 'na') {
         $allowed = "c.id IN ({$this->_session->allowed})";
     } else {
         $allowed = "c.published='1' AND c.pub_access='0'";
     }
     // When we query for topics or categories we have to check against permissions
     switch ($do) {
         case 'getcat':
             $query = "SELECT c.name, c.id\n\t\t\t\t\t\t\tFROM #__kunena_categories AS c\n\t\t\t\t\t\t\tWHERE {$allowed} AND name LIKE '" . $data . "%'\n\t\t\t\t\t\t\tORDER BY 1 LIMIT 0, 10;";
             $this->_db->setQuery($query);
             $result = $this->_db->loadResultArray();
             break;
         case 'gettopic':
             $query = "SELECT m.subject\n\t\t\t\t\t\t\tFROM #__kunena_messages AS m\n\t\t\t\t\t\t\tJOIN #__kunena_categories AS c ON m.catid = c.id\n\t\t\t\t\t\t\tWHERE m.hold=0 AND m.parent=0 AND {$allowed}\n\t\t\t\t\t\t\t\tAND m.subject LIKE '" . $data . "%'\n\t\t\t\t\t\t\tORDER BY 1 LIMIT 0, 10;";
             $this->_db->setQuery($query);
             $result = $this->_db->loadResultArray();
             break;
         case 'getuser':
             $kunena_config = KunenaFactory::getConfig();
             // User the configured display name
             $queryname = $kunena_config->username ? 'username' : 'name';
             // Exclude the main superadmin from the search for security purposes
             $query = "SELECT {$this->_db->nameQuote($queryname)} FROM #__users WHERE block=0 AND `id` != 62 AND {$this->_db->nameQuote($queryname)}\n\t\t\t\t\t\t\tLIKE {$this->_db->Quote("{$data}%")} ORDER BY 1 LIMIT 0, 10;";
             $this->_db->setQuery($query);
             $result = $this->_db->loadResultArray();
             break;
         default:
             // Operation not supported
             $result = array('status' => '-1', 'error' => JText::_('COM_KUNENA_AJAX_INVALID_OPERATION'));
     }
     if ($this->_db->getErrorNum()) {
         $result = array('status' => '-1', 'error' => KunenaError::getDatabaseError());
     }
     return $result;
 }
開發者ID:vuchannguyen,項目名稱:hoctap,代碼行數:40,代碼來源:kunena.ajax.helper.php


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