pahenrus / react-mysqli
Asynchronous & non-blocking MySQL driver for React.PHP
1.0.5
2018-02-19 09:51 UTC
Requires
- php: >=5.4.0
- ext-mysqlnd: *
- react/event-loop: dev-master
- react/promise: ^2.2
This package is not auto-updated.
Last update: 2025-01-18 20:13:53 UTC
README
Asynchronous & non-blocking MySQLi driver for React.PHP.
Require php-mysqlnd extension
Install
composer require pahenrus/react-mysqli
Example
$loop = \React\EventLoop\Factory::create(); $makeConnection = function () { return mysqli_connect('localhost', 'vagrant', '', 'test'); }; $mysql = new \React\MySQLi\Client($loop, new \React\MySQLi\Pool($makeConnection, 10)); $mysql->query('select * from test')->then( function (\React\MySQLi\Result $result) { print_r($result->all()); }, function ($error) { error_log($error); } ); $loop->run();