downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

mysqli::refresh> <mysqli::real_query
[edit] Last updated: Wed, 19 Jun 2013

view this page in

mysqli::reap_async_query

mysqli_reap_async_query

(PHP 5 >= 5.3.0)

mysqli::reap_async_query -- mysqli_reap_async_queryObtiene el resultado de una consulta asincrónica

Descripción

Estilo orientado a objetos

public mysqli_result mysqli::reap_async_query ( void )

Estilo por procedimientos

mysqli_result mysqli_reap_async_query ( mysql $link )
Advertencia

Esta función no está documentada actualmente, solamente se encuentra disponible la lista de parámetros.

Obtiene el resultado de una consulta asincrónica. Disponible sólo con mysqlnd.

Parámetros

link

Sólo estilo por procediminetos: Un identificador de enlace devuelto por mysqli_connect() o mysqli_init()

Valores devueltos

Devuelve mysqli_result en caso de éxito, FALSE en caso contrario.

Ver también



add a note add a note User Contributed Notes mysqli::reap_async_query - [1 notes]
up
0
eric dot caron at gmail dot com
3 years ago
Keep in mind that mysqli::reap_async_query only returns mysqli_result on queries like SELECT. For queries where you may be interested in things like affected_rows or insert_id, you can't work off of the result of mysqli::reap_async_query as the example in mysqli::poll leads you to believe. For INSERT/UPDATE/DELETE queries, the data corresponding to the query can be accessed through the associated key to the first array in the mysqli::poll function.

So instead of
<?php
   
foreach ($links as $link) {
        if (
$result = $link->reap_async_query()) {
           
print_r($result->fetch_row());
           
mysqli_free_result($result);
           
$processed++;
        }
    }
?>

The data is accessible via:
<?php
   
foreach ($links as $link) {
        if (
$result = $link->reap_async_query()) {
           
//This works for SELECT
           
if(is_object($result)){
               
print_r($result->fetch_row());
               
mysqli_free_result($result);
            }
           
//This works for INSERT/UPDATE/DELETE
           
else {
               
print_r($link);
            }
           
$processed++;
        }
    }
?>

 
show source | credits | sitemap | contact | advertising | mirror sites