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


PHP ADODB_mysqli::Prepare方法代码示例

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


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

示例1: prepareStatement

 /**
  * Prepares statement and params
  */
 private function prepareStatement()
 {
     $this->stmt = $this->db->Prepare("\n            SELECT\n              `s`.`server_id` AS `server_id`,\n              `s`.`status`    AS `status`\n            FROM `servers` AS `s`\n              LEFT JOIN `server_properties` AS `attempt`\n                ON `attempt`.`server_id` = `s`.`server_id` AND `attempt`.`name` = ?\n              LEFT JOIN `server_properties` AS `last_try`\n                ON `last_try`.`server_id` = `s`.`server_id` AND `last_try`.`name` = ?\n              LEFT JOIN `temporary_server_status_check_config` AS `config`\n                ON IF(`attempt`.`value` > ?, ?, `attempt`.`value`) = `config`.`attempt`\n              JOIN `clients` AS `c`\n                ON `c`.`id` = `client_id`\n              JOIN `client_environments` AS `e`\n                ON `e`.`id` = `env_id`\n            WHERE\n              `s`.`status` IN (?, ?) AND `s`.`dtadded` < NOW() - INTERVAL 1 DAY OR (\n                `s`.`status` = ? AND\n                `c`.`status` = ? AND\n                `e`.`status` = ? AND (\n                  `attempt`.`value` IS NULL OR\n                  `last_try`.`value` < NOW() - INTERVAL `config`.`interval` DAY_SECOND\n                )\n              )\n        ");
     $maxAttempts = max(array_keys($this->attemptConfig));
     $this->params = [SERVER_PROPERTIES::LAUNCH_ATTEMPT, SERVER_PROPERTIES::LAUNCH_LAST_TRY, $maxAttempts, $maxAttempts, SERVER_STATUS::IMPORTING, SERVER_STATUS::TEMPORARY, SERVER_STATUS::PENDING_LAUNCH, Scalr_Account::STATUS_ACTIVE, Scalr_Environment::STATUS_ACTIVE];
 }
开发者ID:mheydt,项目名称:scalr,代码行数:9,代码来源:ServerStatusManager.php

示例2: hasTableCompatibleIndex

 /**
  * {@inheritdoc}
  * @see UpdateInterface::hasTableCompatibleIndex()
  */
 public function hasTableCompatibleIndex($table, array $columns, $unique = false)
 {
     $compatible = null;
     //Columns may be provided without indexes like ['col1', 'col2', ..., 'colN'].
     //In this case index should mutually start from 1 instead of specified 0.
     $dx = isset($columns[0]) ? 1 : 0;
     $stmt = $this->db->Prepare("SHOW INDEX FROM `{$table}` WHERE `Column_name` = ? AND `Seq_in_index` = ? AND `Non_unique` = ?");
     foreach ($columns as $idx => $column) {
         $entries = $this->db->Execute($stmt, [$column, $idx + $dx, $unique ? 0 : 1]);
         $indexes = [];
         foreach ($entries->GetAll() as $entry) {
             $indexes[] = $entry['Key_name'];
         }
         $compatible = empty($compatible) ? $indexes : array_intersect($compatible, $indexes);
         if (empty($compatible)) {
             return false;
         }
     }
     return empty($compatible) ? false : $compatible;
 }
开发者ID:sacredwebsite,项目名称:scalr,代码行数:24,代码来源:AbstractUpdate.php


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