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


PHP ADODB_mysqli::escape方法代码示例

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


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

示例1: parseFindCriteria

 /**
  * Parses common criteria
  *
  * @param     array    $criteria array of the query search criteria
  * @param     string   $join     joins
  * @param     string   $where    where part of the statement
  */
 private function parseFindCriteria($criteria, &$join, &$where)
 {
     if (isset($criteria['accountId'])) {
         $join .= " JOIN account_ccs ac ON ac.cc_id = c.cc_id ";
         $where .= "\n                AND ac.account_id = " . $this->db->escape($criteria['accountId']) . "\n                AND EXISTS (\n                    SELECT 1 FROM projects p WHERE p.cc_id = c.cc_id\n                    AND p.shared = " . ProjectEntity::SHARED_WITHIN_ACCOUNT . "\n                    AND p.account_id = " . $this->db->escape($criteria['accountId']) . "\n               )\n           ";
     }
 }
开发者ID:mheydt,项目名称:scalr,代码行数:14,代码来源:CostCentres.php

示例2: checkPermission

 /**
  * Checks if user has permissions to project in environment or account scope
  *
  * @param string $projectId     Identifier of the project
  * @param array $criteria       ['envId' => '', 'clientid' => '']
  * @return bool|mixed
  */
 public function checkPermission($projectId, array $criteria)
 {
     $and = '';
     foreach ($criteria as $name => $value) {
         $field = 'f.' . \Scalr::decamelize($name);
         $and .= " AND " . $field . "=" . $this->db->escape($value);
     }
     $projectEntity = new ProjectEntity();
     $projectId = $projectEntity->type('projectId')->toDb($projectId);
     $where = " WHERE p.project_id = UNHEX('" . $projectId . "') AND EXISTS (\n                SELECT * FROM farms f\n                LEFT JOIN farm_settings fs ON f.id = fs.farmid\n                WHERE fs.name = '" . Entity\FarmSetting::PROJECT_ID . "'\n                AND REPLACE(fs.value, '-', '') = HEX(p.project_id)\n                {$and})";
     $sql = "SELECT " . $projectEntity->fields('p') . "\n                FROM " . $projectEntity->table('p') . $where;
     return $this->db->GetOne($sql);
 }
开发者ID:mheydt,项目名称:scalr,代码行数:20,代码来源:Projects.php

示例3: findFarmsByKey

 /**
  * Finds farms by key
  * It searches by name
  *
  * @param   int       $envId     Current enviroment id
  * @param   string    $key       optional Search key
  * @return  ArrayCollection Returns collection of the farm objects
  */
 public function findFarmsByKey($envId, $key = null)
 {
     $statement = "\n            SELECT *\n            FROM farms f\n            WHERE f.env_id = " . intval($envId) . "\n        ";
     if (!is_null($key) && $key !== '') {
         $statement .= "\n                AND f.name LIKE '%" . $this->db->escape($key) . "%'\n            ";
     }
     $collection = new ArrayCollection();
     $rs = $this->db->Execute($statement);
     while ($rec = $rs->FetchRow()) {
         $item = DBFarm::loadFields($rec);
         $collection->append($item);
     }
     return $collection;
 }
开发者ID:scalr,项目名称:scalr,代码行数:22,代码来源:Usage.php

示例4: hasTable

 /**
  * {@inheritdoc}
  * @see Scalr\Upgrade.UpdateInterface::hasTable()
  */
 public function hasTable($table, $database = null)
 {
     $ret = $this->db->getOne("SHOW TABLES " . ($database ? "FROM `" . $this->db->escape($database) . "` " : "") . "LIKE ?", array($table));
     return $ret ? true : false;
 }
开发者ID:rickb838,项目名称:scalr,代码行数:9,代码来源:AbstractUpdate.php


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