netsilik / db-handler
PHP wrapper around the MySQLi Database Extensions, providing intuitive access to prepared queries.
Installs: 1 201
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- ext-mysqli: *
Requires (Dev)
- netsilik/base-test-case: ^0.10
- netsilik/d: ^1.0
- phpunit/phpunit: ^8.2
README
PHP wrapper around the MySQLi Database Extensions, providing intuitive access to prepared queries.
European Union Public Licence, v. 1.1
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Contact: info@netsilik.nl Latest version available at: https://gitlab.com/Netsilik/DbHandler
Installation
composer require netsilik/db-handler
Usage
use Netsilik\DbHandler; $dbHandler = new DbHandler('localhost', 'user', 'password', 'test'); $result = $dbHandler->query("INSERT INTO tests VALUES (null, %s)", 'foo'); $result = $dbHandler->query("SELECT * FROM tests ORDER BY id DESC LIMIT 3"); var_dump( $result->getInsertedId() ); var_dump( $result->getAffectedRecords() ); var_dump( $result->getFieldCount() ); var_dump( $result->getRecordCount() ); var_dump( $result->fetch() ); $result->dump(); echo '<hr>'; $result = $dbHandler->rawQuery("INSERT INTO tests VALUES (null, 'foo')"); $result = $dbHandler->query("SELECT * FROM tests ORDER BY id DESC LIMIT 3"); var_dump( $result->getInsertedId() ); var_dump( $result->getAffectedRecords() ); var_dump( $result->getFieldCount() ); var_dump( $result->getRecordCount() ); var_dump( $result->fetch() ); $result->dump();