Introduction - Query

Introduction - Query -- Performing queries

Description

PEAR DB provides several methods for querying databases. The most direct method is query(). It takes a SQL query string as an argument. There are three possible returns: a new DB_result object for queries that return results (such as SELECT queries), DB_OK for queries that manipulate data (such as INSERT queries) or a DB_Error object on failure.

query() can be used instead of prepare() and execute(), if you set the $params parameter and your query uses placeholders.