note 113437 added to function.pg-get-result

From: Date: Thu, 10 Oct 2013 06:28:39 +0000
Subject: note 113437 added to function.pg-get-result
Groups: php.notes 
Request: Send a blank email to php-notes+get-196519@lists.php.net to get a copy of this message
To have a a simple wait output with async queries you can use the pg_connection_busy command: <?php $dbh = pg_connect("host=XXX user=XXX password=XXX dbname=XXX"); if (!$dbh) { print "Failed to connect"; exit; } $query = "SELECT pg_sleep(10)"; if (!pg_connection_busy($dbh)) { $sent = pg_send_query($dbh, $query); print "Sent query, waiting: "; while (pg_connection_busy($dbh) { print "."; flush(); } $res = pg_get_result($dbh); print "<br>"; // or \n print "Result is: $res"; } pg_close($dbh); ?> ---- Server IP: 69.147.83.199 Probable Submitter: 122.216.43.108 ---- Manual Page -- http://php.net/manual/en/function.pg-get-result.php Edit -- https://master.php.net/note/edit/113437 Del: integrated -- https://master.php.net/note/delete/113437/integrated Del: useless -- https://master.php.net/note/delete/113437/useless Del: bad code -- https://master.php.net/note/delete/113437/bad+code Del: spam -- https://master.php.net/note/delete/113437/spam Del: non-english -- https://master.php.net/note/delete/113437/non-english Del: in docs -- https://master.php.net/note/delete/113437/in+docs Del: other reasons-- https://master.php.net/note/delete/113437 Reject -- https://master.php.net/note/reject/113437 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#196519) next »