当前位置: 首页>>代码示例>>PHP>>正文


PHP JDatabase::escape方法代码示例

本文整理汇总了PHP中JDatabase::escape方法的典型用法代码示例。如果您正苦于以下问题:PHP JDatabase::escape方法的具体用法?PHP JDatabase::escape怎么用?PHP JDatabase::escape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JDatabase的用法示例。


在下文中一共展示了JDatabase::escape方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: escape

 /**
  * Esegue l'escape di una stringa per l'inserimento in una query
  * FUNZIONE CHIAMATA DAL MODULO DEVE ESSERE SEMPRE IMPLEMENTATA QUI
  * @param string $text
  * @return string
  */
 public function escape($text)
 {
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         return $this->db->escape($text);
     } else {
         return $this->db->getEscaped($text);
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:14,代码来源:ProPayment_Database.php

示例2: quote

 /**
  * Method to quote and optionally escape a string to database requirements for insertion into the database.
  * @param   string $text   The string to quote.
  * @param   bool   $escape True to escape the string, false to leave it unchanged.
  * @return  string  The quoted input string.
  */
 public function quote($text, $escape = true)
 {
     if (version_compare(JVERSION, '1.5.0', '>')) {
         $escape = false;
     } else {
         $escape = true;
     }
     return $this->db->quote($escape ? $this->db->escape($text) : $text);
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:15,代码来源:JBDatabaseQuery.php

示例3: stringMatch

 /**
  * @param $field
  * @param $data
  */
 protected function stringMatch($field, $data)
 {
     $wheres = array();
     foreach ($data as $match) {
         $match = trim($match);
         if (!empty($match)) {
             $wheres[] = $field . ' LIKE ' . $this->db->quote('%' . $this->db->escape($match, true) . '%');
         }
     }
     if (!empty($wheres)) {
         $this->filter_where[] = '(' . implode(' OR ', $wheres) . ')';
     }
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:17,代码来源:AbstractJoomlaPlatformFilter.php

示例4: getTableKeyExpression

 /**
  * Method to get a query expression for a table key.
  *
  * @param   string   $alias     The table alias.
  * @param   string   $key       The table key alias.
  * @param   boolean  $useAlias  True to use the alias in the expression, false otherwise.
  *
  * @return  string  The table expression.
  *
  * @since   12.1
  * @throws  InvalidArgumentException
  */
 protected function getTableKeyExpression($alias, $key, $useAlias = true)
 {
     $return = '';
     // Assert that the table alias is defined.
     if (!array_key_exists($alias, $this->tables) || !array_key_exists($alias, $this->keys)) {
         throw new InvalidArgumentException(JText::sprintf('JDATABASEOBJECT_INVALID_TABLE', $alias));
     }
     // Check if the key is a column.
     if (isset($this->keys[$alias][$key])) {
         // Quote the column name.
         $column = $this->db->quoteName($this->keys[$alias][$key]);
     } else {
         // Escape the expression.
         $column = $this->db->escape($key);
     }
     // Check if we should use the table alias.
     if ($useAlias) {
         $return .= $this->db->quoteName($alias) . '.';
     }
     // Build the table expression.
     $return .= $column;
     return $return;
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:35,代码来源:object.php

示例5: getEscaped

 /**
  * Get a database escaped string. For LIKE statemends: $db->Quote( $db->getEscaped( $text, true ) . '%', false )
  *
  * @param  string  $text
  * @param  boolean $escapeForLike : escape also % and _ wildcards for LIKE statements with % or _ in search strings  (since CB 1.2.3)
  * @return string
  */
 public function getEscaped($text, $escapeForLike = false)
 {
     return $this->_db->escape($text, $escapeForLike);
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:11,代码来源:CmsDatabaseDriver.php

示例6: getEscaped

 /**
  * Get a database escaped string. For LIKE statemends: $db->Quote( $db->getEscaped( $text, true ) . '%', false )
  *
  * @param  string  $text
  * @param  boolean $escapeForLike : escape also % and _ wildcards for LIKE statements with % or _ in search strings  (since CB 1.2.3)
  * @return string
  */
 function getEscaped($text, $escapeForLike = false)
 {
     if (checkJversion() >= 2) {
         $result = $this->_db->escape($text);
     } else {
         $result = $this->_db->getEscaped($text);
     }
     if ($escapeForLike) {
         $result = str_replace(array('%', '_'), array("\\%", "\\_"), $result);
     }
     return $result;
 }
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:19,代码来源:cb.database.php


注:本文中的JDatabase::escape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。