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


PHP DBConnection::id方法代码示例

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


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

示例1: escape

 /**
  * Return an escaped string for use in a query.
  *
  * @param string $string The string to escape.
  * @param boolean $escapeall Set true to also escape _ and % for LIKE queries.
  * @return string 
  */
 public static function escape($string, $escapeall = false)
 {
     if (is_null(self::$dbconn)) {
         self::$dbconn = new DBConnection();
     }
     if ($escapeall) {
         return addcslashes(self::$dbconn->id()->real_escape_string($string), '%_');
     } else {
         return self::$dbconn->id()->real_escape_string($string);
     }
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:18,代码来源:class.dbbasequery.php

示例2: profile

 public static function profile($sql, $time = 0)
 {
     if (KB_PROFILE == 2) {
         file_put_contents(self::$qerrfile, $sql . "\nExecution time: " . $time . "\n", FILE_APPEND);
     }
     if (KB_PROFILE == 3) {
         if (DB_TYPE == 'mysqli' && strtolower(substr($sql, 0, 6)) == 'select') {
             $dbconn = new DBConnection();
             $prof_out_ext = $prof_out_exp = '';
             $prof_qry = mysqli_query($dbconn->id(), 'EXPLAIN extended ' . $sql . ";");
             while ($prof_row = mysqli_fetch_assoc($prof_qry)) {
                 $prof_out_exp .= implode(' | ', $prof_row) . "\n";
             }
             $prof_qry = mysqli_query($dbconn->id(), 'show warnings');
             while ($prof_row = mysqli_fetch_assoc($prof_qry)) {
                 $prof_out_ext .= implode(' | ', $prof_row) . "\n";
             }
             file_put_contents(self::$qerrfile, $sql . "\n" . $prof_out_ext . $prof_out_exp . "\n-- Execution time: " . $time . " --\n", FILE_APPEND);
         } else {
             file_put_contents(self::$qerrfile, $sql . "\nExecution time: " . $time . "\n", FILE_APPEND);
         }
     }
     if (KB_PROFILE == 4) {
         if ($time > 0.1 && strtolower(substr($sql, 0, 6)) == 'select') {
             $dbconn = new DBConnection();
             $prof_out_exp = $prof_out_exp = '';
             $prof_qry = mysqli_query($dbconn->id(), 'EXPLAIN extended ' . $sql);
             while ($prof_row = mysqli_fetch_assoc($prof_qry)) {
                 $prof_out_exp .= implode(' | ', $prof_row) . "\n";
             }
             $prof_qry = mysqli_query($dbconn->id(), 'show warnings');
             while ($prof_row = mysqli_fetch_assoc($prof_qry)) {
                 $prof_out_ext .= implode(' | ', $prof_row) . "\n";
             }
             file_put_contents(self::$qerrfile, $sql . "\n" . $prof_out_ext . $prof_out_exp . "\n-- Execution time: " . $time . " --\n", FILE_APPEND);
         }
     }
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:38,代码来源:class.dbdebug.php

示例3: find_SQL_Version

function find_SQL_Version()
{
    $conn = new DBConnection();
    $value = (double) mysqli_get_server_info($conn->id());
    return $value;
}
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:6,代码来源:admin_troubleshooting.php


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