Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 87 | | All time: 9,998 This week: 455 |
|
Description | | Author |
This package can manipulate records in a page done using ReactPHP.
It provides an example class that acts as an interface to manipulate records of SQL database table that stores records of users.
The class performs database access operations using ReactPHP to execute the database access queries.
Applications need to use callback functions to process the results of the database queries. | |
|
|
Innovation award
Nominee: 9x |
|
Example
<?php
use Crud\User;
use React\EventLoop\Factory;
use React\MySQL\QueryResult;
require 'vendor/autoload.php';
$loop = Factory::create();
$user = new User($loop);
$user->create('Carliedu', 'clu.123')
->then(function (QueryResult $queryResult) use ($user) {
echo("\nUser created successfully\nUserID: {$queryResult->insertId}.\n");
$user->getConnection()->close();
})
->otherwise(function (Throwable $exception) {
echo $exception;
});
$loop->run();
|
Details
ReactPHP DB CRUD
ReactPHP simple database crud operation.
Installation
Clone this repo
git clone https://github.com/Ahmard/reactphp-crud.git
Install composer packages
cd reactphp-crud
composer update
DB Config
Edit .env file add update it with DB credentials
DB_USER = "root"
DB_PASS = "password"
DB_HOST = "127.0.0.1"
DB_NAME = "myDatabase"
Install DB Tables
Before using this crud demo, DB tables must be installed first.
php create-tables.php
Running Demo
Create new user
php create.php
Read user info
php read.php
Update user info
php create.php
Delete user
php delete.php
List all users
php list.php
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.