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


PHP mysqli::kill方法代码示例

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


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

示例1: __destruct

 /**
  * Connection destructor
  */
 public function __destruct()
 {
     if (isset($this->mysqli) && !$this->mysqli->connect_error) {
         $threadId = $this->mysqli->thread_id;
         $this->mysqli->kill($threadId);
         $this->mysqli->close();
     }
 }
开发者ID:justin-robinson,项目名称:scoop,代码行数:11,代码来源:connection.php

示例2: disconnect

 /**
  * Disconnects from mysql-server.
  *
  * @return void
  */
 public function disconnect()
 {
     if ($this->connected !== TRUE) {
         return;
     }
     $this->mysqli->kill($this->mysqli->thread_id);
     $this->mysqli->close();
     $this->connected = FALSE;
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:14,代码来源:MySQLConnection.php

示例3: implode

     $holds_keys = implode(',', $holds_keys);
     $sql = 'SELECT * FROM locum_holds_count ' . 'WHERE bnum IN (' . $holds_keys . ')';
     if ($result = $mysqli->query($sql)) {
         while ($holds_count = $result->fetch_assoc()) {
             $bnum = $holds_count['bnum'];
             $bibs[$bnum] = array_merge($bibs[$bnum], $holds_count);
         }
         $result->free();
     } else {
         // Query Error, log and move on
         $log_msg .= sprintf("HOLDS QUERY ERROR:\n\t%s\n\tQUERY: %s\n", $mysqli->error, $sql);
     }
     unset($result);
 }
 // Kill the mysqli connection
 $mysqli->kill($mysqli->thread_id);
 $mysqli->close();
 unset($mysqli);
 $bibs_time = number_format(microtime(true) - $child_time_start, 3);
 foreach ($bibs as &$bib) {
     $loop_start = microtime(true);
     prep_bib($bib);
     $prep_time = microtime(true);
     $prep_total += $prep_time - $loop_start;
     write_sphinx_doc_xml($config, $bib, $offset);
     $write_total += microtime(true) - $prep_time;
 }
 // Write to Log
 $mem_usage = memory_get_usage();
 $current_time = '[' . date("H:i:s") . ']';
 $child_time_elapsed = number_format(microtime(true) - $child_time_start, 3);
开发者ID:aadl,项目名称:locum,代码行数:31,代码来源:update-sphinx-xml.php

示例4: mysqli

    function StoredProcedureArray2($query="") {
        //Me conecto a la base de datos

        $mysqli = new mysqli("atc-nh-natsdb.nationalnet.com", "staffcenter", "XgwofvLY2ayLf", "staffcenter");

        /* check connection */
        if (mysqli_connect_errno()) {
            printf("<br />Failed to connect to the database: %s\n", mysqli_connect_error());
            exit();
        }

        //LLama al stored procedure
        if ($mysqli->multi_query($query)) {
            /* guarda el resultado del stored procedure */
            $result = $mysqli->store_result();
            $mysqli->kill($mysqli->thread_id);
            $mysqli->close();
            return $result;
        }
    }
开发者ID:rommelxcastro,项目名称:CRI-Online-Sales---Admin,代码行数:20,代码来源:conexion.php

示例5:

 if (isset($_GET['i']) && $_GET['i'] == "hash") {
     echo pass_hash("ripemd160", $_GET['p'], "SALT", "PEPPER");
 } else {
     if (isset($_POST['user'])) {
         $user = $_POST['user'];
         $pass = $_POST['pass'];
         $query = $db->query("SELECT `pass` FROM `users` WHERE `user`='{$user}'");
         $result = $query->fetch_assoc();
         $verify = pass_verify("ripemd160", $pass, $result['pass'], "SALT", "PEPPER");
         if ($verify == TRUE) {
             $_SESSION['user'] = $user;
             echo 1;
         } else {
             echo 0;
         }
         $db->kill($db->thread_id);
         $db->close();
     } else {
         if (isset($_POST['key'])) {
             $key = $_POST['key'];
             $email = $_POST['email'];
             $query = $db->query("SELECT `accesskey`,`user` FROM `accesskeys` WHERE `accesskey`='{$key}'");
             $result = $query->fetch_assoc();
             $verify = pass_verify("ripemd160", $email, $result['accesskey'], "SALT", "PEPPER");
             if ($verify == TRUE) {
                 if ($result['user'] == NULL || $result['user'] == "") {
                     echo 1;
                 } else {
                     echo 0;
                 }
             } else {
开发者ID:alexpja,项目名称:Klaud,代码行数:31,代码来源:processLogin.php

示例6: mysqltest

function mysqltest()
{
    global $log_format, $db_con, $debug, $database, $mysql_host, $mysql_user, $mysql_password, $command_line, $tmp_dir;
    //  get our current MySQL thread id and if new, save it
    $thread_id = "" . $db_con->thread_id . "\r\n";
    $all_ids = @file_get_contents("" . $tmp_dir . "/thread_ids.txt");
    //  if the index procedure meanwhile was manually aborted (for multi threaded indexing)
    if (!is_file("" . $tmp_dir . "/thread_ids.txt") || !$all_ids) {
        $db_con->kill($thread_id);
        //close last MySQL connection
        $cl = '';
        $report = "Indexation manually aborted.";
        printCancel($report, $cl);
        printEndHTMLBody($cl);
        exit;
        //  terminate this indexing thread completely
    }
    $mysql_fail = '';
    $check1 = '0';
    $check2 = '0';
    if ($check1 = $db_con->ping() != '1') {
        $dbtries = 0;
        while ($dbtries < 5 && ($check1 = $db_con->ping() != '1')) {
            $dbtries++;
            printDB_errorReport('noSQL', $command_line, '1');
            sleep(10);
            $db_con = new mysqli($mysql_host, $mysql_user, $mysql_password);
            if (!$db_con) {
                $mysql_fail = '1';
            }
            //echo "<span class='blue sml'>&nbsp;&nbsp;Cannot connect to database.<br /></span>";
            if ($db_con) {
                $success = mysqli_select_db($link, $database);
                if (!$success) {
                    $mysql_fail = '1';
                    //echo "<p class='blue sml'>&nbsp;&nbsp;Cannot choose database.<br /></p>";
                }
            }
        }
        if ($check2 = $db_con->ping() != '1') {
            printDB_errorReport('noSucc', $command_line, '1');
            //  failed 5 times. End of index procedure
            printDB_errorReport('aborted', $command_line, '1');
            printDB_errorReport('end', $command_line, '1');
            die('');
        }
        printStandardReport('newSQL', $command_line, '1');
        //  reconnected to db
    }
    //  get our current MySQL thread id and if new, save it
    $thread_id = "" . $db_con->thread_id . "\r\n";
    $all_ids = @file("" . $tmp_dir . "/thread_ids.txt");
    //  if the index procedure meanwhile was manually aborted (for multi threaded indexing)
    if (!is_file("" . $tmp_dir . "/thread_ids.txt") || !is_array($all_ids)) {
        $db_con->kill($thread_id);
        //close last MySQL connection
        $cl = '';
        $report = "Indexation manually aborted.";
        printCancel($report, $cl);
        printEndHTMLBody($cl);
        exit;
        //  terminate this indexing thread completely
    }
    if (!in_array($thread_id, $all_ids)) {
        $fp = fopen("" . $tmp_dir . "/thread_ids.txt", "a+");
        //  try to write
        if (!is_writeable("" . $tmp_dir . "/thread_ids.txt")) {
            echo "\n                    <br /><br />\n                    <p class='warnadmin cntr'>\n                    <br /><br />\n                    Unable to open the file .../admin/" . $tmp_dir . "/thread_ids.txt\n                    <br /><br />\n                    Index procedure aborted.\n                    <br /><br /></p>\n                    <br /><br />\n                    <p class='evrow'><a class='bkbtn' href='admin.php' title='Go back to Admin'>Back to admin</a></p>\n                    <br /><br />\n                </body>\n            </html>\n                        ";
            exit;
        }
        if (!fwrite($fp, $thread_id)) {
            echo "\n                    <br /><br />\n                    <p class='warnadmin cntr'>\n                    <br /><br />\n                    Unable to write the actual MySQL thread-id into file " . $tmp_dir . "/thread_ids.txt\n                    <br /><br />\n                    Index procedure aborted.\n                    <br /><br /></p>\n                    <br /><br />\n                    <p class='evrow'><a class='bkbtn' href='admin.php' title='Go back to Admin'>Back to admin</a></p>\n                    <br /><br />\n                </body>\n            </html>\n                ";
            exit;
        }
        fclose($fp);
    }
    return $mysql_fail;
}
开发者ID:hackersforcharity,项目名称:rachelpiOS,代码行数:78,代码来源:spiderfuncs.php

示例7: close

 function close()
 {
     parent::kill($this->thread_id);
     parent::close();
 }
开发者ID:henrikhermansen,项目名称:Webprogprosjekt,代码行数:5,代码来源:sql.php


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