Warning: file_put_contents(): Only -1 of 120 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
mysqli_insert_id mysqli_master_query mysqli PHP Manual mysqli_kill mysqli->kill (PHP 5) mysqli->kill — Le pide al servidor "matar" el proceso MySQL Descripción Estilo por procedimie...
Forum und email

mysqli_kill

mysqli->kill

(PHP 5)

mysqli->kill — Le pide al servidor "matar" el proceso MySQL

Descripción

Estilo por procedimientos:

bool mysqli_kill ( mysqli $identificador_de_enlace , int $processid )

Estilo orientado a objetos (métod0)

mysqli
bool kill ( int $processid )

Esta función es usada para pedir al servidor matar le proceso MySQL específicado por el parámetro processid . Este valor debe ser obtenido llamando la función mysqli_thread_id().

Note: Para detenener una consulta que se está ejecutando, debes usar el commando KILL QUERY processid.

Valores retornados

Devuelve TRUE si todo se llevó a cabo correctamente, FALSE en caso de fallo.

Ver también

mysqli_thread_id().

Ejemplos

Example#1 Estilo orientado a objetos

<?php
$mysqli 
= new mysqli("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
    
printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

/* determine our thread id */
$thread_id = $mysqli->thread_id;

/* Kill connection */
$mysqli->kill($thread_id);

/* This should produce an error */
if (!$mysqli->query("CREATE TABLE myCity LIKE City")) {
    
printf("Error: %s\n", $mysqli->error);
    exit;
}

/* close connection */
$mysqli->close();
?>

Example#2 Estilo por procedimientos

<?php
$link 
= mysqli_connect("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
    
printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

/* determine our thread id */
$thread_id = mysqli_thread_id($link);

/* Kill connection */
mysqli_kill($link, $thread_id);

/* This should produce an error */
if (!mysqli_query($link, "CREATE TABLE myCity LIKE City")) {
    
printf("Error: %s\n", mysqli_error($link));
    exit;
}

/* close connection */
mysqli_close($link);
?>

El resultado del ejemplo seria:

Error: MySQL server has gone away