Home > PHP > Function > > ingres_query()

ingres_query()

ingres_query - Send an SQL query to Ingres

Syntax

mixed ingres_query (resource $link, string $query, array $params, string $types)

Arguments

  • link - The connection link identifier.
  • query - A valid SQL query (see the Ingres SQL reference guide) in the Ingres documentation. Data inside the query should be properly escaped. The following types of SQL queries cannot be sent with this function: close(see ingres_close()) commit(see ingres_commit()) connect(see ingres_connect()) disconnect(see ingres_close()) get dbevent prepare to commit rollback(see ingres_rollback()) savepoint set autocommit(see ingres_autocommit()) all cursor-related queries are unsupported
  • params - An array of parameter values to be used with the query
  • types - A string containing a sequence of types for the parameter values passed. When ingres.describeis enabled, this parameter can be ignored as the driver automatically fetches the expected parameter types from the server. Type code Ingres type b BYTE B LONG BYTE/BLOB c CHAR d DATE/ANSIDATE/TIMESTAMP/TIME f FLOAT i INTEGER L LONG TEXT m MONEY M LONG NVARCHAR n NCHAR N NVARCHAR t TEXT v VARCHAR V LONG VARCHAR

Description

ingres_query() sends the given query to the Ingres server.

Version

PHP 4.0.2, 5 <= 5.0.5, PECL ingres >= 1.0.0

Return value

ingres_query() returns a query result identifier on success else it returns FALSE. To see if an error occurred use ingres_errno(), ingres_error() or ingres_errsqlstate().