Home > PHP > Function > PostgreSQL > pg_send_query()

pg_send_query()

pg_send_query - Sends asynchronous query

Syntax

bool pg_send_query (resource $connection, string $query)

Arguments

  • connection - PostgreSQL database connection resource.
  • query - The SQL statement or statements to be executed. Data inside the query should be properly escaped.

Description

pg_send_query() sends a query or queries asynchronously to the connection. Unlike pg_query(), it can send multiple queries at once to PostgreSQL and get the results one by one using pg_get_result().

Version

PHP 4.2.0, 5

Return value

Returns TRUE on success or FALSE on failure.