PHPackages                             activecollab/databaseconnection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. activecollab/databaseconnection

ActiveLibrary[Database &amp; ORM](/categories/database)

activecollab/databaseconnection
===============================

A couple of simple helper methods wrapped around MySQLi connection

5.1.8(2mo ago)078.1k↓50.3%1[1 issues](https://github.com/activecollab/databaseconnection/issues)6MITPHPPHP &gt;=8.0CI failing

Since Aug 12Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/activecollab/databaseconnection)[ Packagist](https://packagist.org/packages/activecollab/databaseconnection)[ Docs](https://labs.activecollab.com)[ RSS](/packages/activecollab-databaseconnection/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (25)Used By (6)

DatabaseConnection Library
==========================

[](#databaseconnection-library)

[![Build Status](https://camo.githubusercontent.com/4a56da09272ac9bc4bb8dde4659efd24b4f28370538f4fcbac7de94c02f2b86e/68747470733a2f2f7472617669732d63692e6f72672f616374697665636f6c6c61622f6461746162617365636f6e6e656374696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/activecollab/databaseconnection)

Purpose of this library is not to abstract the database, but to make work with MySQLi connections a bit easier. Features:

1. Results that can be easily iterated,
2. Results can be arrays of rows, or objects, loaded by a known class name, or by a class name read from the row field,
3. Automatic value casting based on field name.

What's the thinking behind yet another database abstraction layer? Focus and history. This library has been part of [Active Collab](https://www.activecollab.com) for many years, so it works really well. On the other hand, it's simple - works only with MySQL, can be read and understood in an hour and still manages to save you a lot of time.

Getting the Data
----------------

[](#getting-the-data)

This library makes query execution quick and easy. You can fetch all records, only first record, only first column or only first cell (first column of the first record). Here's a couple of examples:

```
