PHP Classes

File: delete.php

Recommend this page to a friend!
  Classes of Ahmad Mustapha   Simple React PHP CRUD   delete.php   Download  
File: delete.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: 3 years ago
Size: 394 bytes
 

Contents

Class file image Download
<?php

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

require
'vendor/autoload.php';

$loop = Factory::create();

$user = new User($loop);

$user->delete(1)
    ->
then(function () use ($user) {
        echo(
"\nUser has been deleted successfully.\n");
       
$user->getConnection()->close();
    })
    ->
otherwise(function (Throwable $exception) {
        echo
$exception;
    });

$loop->run();