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, 22 May 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_queryLit un résultat pour une requête asynchrone

Description

Style orienté objet

public mysqli_result mysqli::reap_async_query ( void )

Style procédural

mysqli_result mysqli_reap_async_query ( mysql $link )
Avertissement

Cette fonction n'est pas documentée et seule la liste des arguments est disponible.

Lit le résultat pour une requête asynchrone. Disponible uniquement avec mysqlnd.

Liste de paramètres

link

Seulement en style procédural : Un identifiant de lien retourné par la fonction mysqli_connect() ou par la fonction mysqli_init()

Valeurs de retour

Retourne un objet mysqli_result en cas de succès, et FALSE sinon.

Voir aussi



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