Download the PHP package xrstf/comfydb without Composer
On this page you can find all versions of the php package xrstf/comfydb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xrstf/comfydb
More information about xrstf/comfydb
Files in xrstf/comfydb
Informations about the package comfydb
ComfyDB
ComfyDB is a wrapper around PHP's mysqli extension and aimed to provide convenience methods for common tasks like fetching one row, fetching one column etc.
Note that performance is not the main focus of this library. All fetched result sets will be read in full, so when you want to stream-process large result sets, this might not be the droid you're looking for.
Also, this library is not using mysqli's prepared statement support to handle parameterized queries.
Instead, a sprintf-like approach is used, where placeholders like %s
or %d
are replaced
before the query is sent to to the server.
Examples: Connecting
Connect to a database:
Examples: Query Data
Select data. Rows are always associative arrays. No magic here.
Fetch a single column from the result set. The return value is a flat array of the values.
Fetch a result set and use the first column as the key in the final result. If only two columns are selected, the value in the final map is not an array, but the second column.
Fetch a single row. If only one column is selected, that value of the first row is
returned instead of an associative array. If no rows are found, null
is returned.
If more than one row is found, only the first is taken into consideration.
Examples: Update Data
update()
takes the table name, the new data and the WHERE criteria.
Examples: Insert Data
insert()
takes the table name and the new data.
Examples: Delete Data
delete()
takes the table name and the WHERE criteria, like update()
.
Examples: Error Handling
In case of any error, a xrstf\ComfyException
is thrown, which contains the error code,
error message and the failed query.
All versions of comfydb with dependencies
ext-mysqli Version *