pg_send_query() send asynchronous query to the connection. Unlike pg_query(), it can send multiple query to PostgreSQL and get the result one by one using pg_get_result(). Script execution is not blocked while query is executing. Use pg_connection_busy() to check connection is busy (i.e. query is executing). Query may be cancelled by calling pg_cancel_query().
Although user can send multiple query at once, user cannot send multiple query over busy connection. If query is sent while connection is busy, it waits until last query is finished and discards all result.
Example 1. Asynchronous Queries
The above example would produce the following output:
|Sites of interest: Web Hosting : Reseller Hosting : Website Hosting : HTML Editor : Web Design Templates : Free Web Hosting : ASP code examples : PHP & MySQL Code Examples|