Skip to content

Instantly share code, notes, and snippets.

@aleduca
Created July 29, 2023 15:35
Show Gist options
  • Save aleduca/91dfd1e245e94745e64a932532aef7ae to your computer and use it in GitHub Desktop.
Save aleduca/91dfd1e245e94745e64a932532aef7ae to your computer and use it in GitHub Desktop.
<?php
$db = \Config\Database::connect();
$db->transStart();
$builder = $db->table('users');
$builder->where('id', 1);
$builder->update([
'firstName' => 'Alexandre'
]);
$builder->delete(['ids' => 1]);
$db->transComplete();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment