You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Maurits,
I needed a callback function that got triggered on a new db entry (Create).
For example I wanted to send an e-mail to a newly registered member.
In this example I have a "members" table with the columns: id , firstName, lastName, email
the yourEmailFunction method will send a welcome message to the newly entered member.
```php
$api = new PHP_CRUD_API(array(
'after_create'=>function($db,$tab,$row) {
if ($tab == 'members')
yourEmailFunction($row['firstName'],$row['lastName'],$row['email']);
}
}
));
$api->executeCommand();
```
Tell me you thoughts... maybe if you like it and willing to accept the pull request I can also create an after_delete and after_update method.
0 commit comments