Fetch the entire result set of a query into a nested array. The function takes care of doing the query and freeing the results when finished.
the SQL query or the statement to prepare
array to be used in execution of the statement. Quantity of array elements must match quantity of placeholders in query. This function does NOT support scalars.
prepare()/ execute() is used.
the fetch mode to use, default is DB_FETCHMODE_DEFAULT
Table 21-1. Possible PEAR_Error values
| Error code | Error message | Reason | Solution |
|---|---|---|---|
| DB_ERROR_INVALID | NULL | SQL statment for preparing is not valid. | See the prepare() documentation, if you want to use a SQL statemt using placeholders. |
| DB_ERROR_MISMATCH | NULL | Quantity of parameters didn't match quantity of placeholders in the prepared statment. | Check that the number of placeholders in the prepare() statement passed to $query equals the count of entries passed to $params. |
| DB_ERROR_NODBSELECTED | NULL | No database was choosen. | Check the DSN in connect(). |
| every other error code | Database specific error | Check the database related section of PHP-Manual to detect the reason for this error. In the most cases a misformed SQL statment. Ie. using LIMIT in a SQL-Statment for an Oracle database. |