PHP Classes

File: read.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha  >  Simple React PHP CRUD  >  read.php  >  Download  
File: read.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple React PHP CRUD
Manipulate records in a page done using ReactPHP
Author: By
Last change:
Date: 1 year ago
Size: 432 bytes
 

Contents

Class file image Download
<?php

use Crud\User;
use
React\EventLoop\Factory;
use
React\MySQL\QueryResult;

require
'vendor/autoload.php';

$loop = Factory::create();

$user = new User($loop);

$user->read(1)
    ->
then(function (QueryResult $queryResult) use ($user) {
       
var_dump($queryResult->resultRows);
       
$user->getConnection()->close();
    })
    ->
otherwise(function (Throwable $exception) {
        echo
$exception;
    });

$loop->run();

For more information send a message to info at phpclasses dot org.