rocketphp/mysqli

Prepared statements - implements MySQLi client.

1.0.0 2015-09-01 19:28 UTC

This package is not auto-updated.

Last update: 2024-05-15 08:33:41 UTC


README

Build Status Coverage Status Dependency Status

Latest Stable Version License

RocketPHP\MySQLi uses the MySQL Improved Extension to perform queries on a MySQL database via prepared statements.

To perform a query on a database – start with an instance of MySQLi and use the select, insert, update, update many and delete query methods.

use RocketPHP\MySQLi\MySQLi;

$mysqli = new MySQLi([
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'example_db',
    'port'     => null,
]);

$sql = "SELECT * FROM table_name
        WHERE column_name = ?";
$values = array('column_value');
$fmt = array('%s');
$result = $mysqli->select($sql, 
                          $values,
                          $fmt);