Use 'insert ... returning' instead of 'Db::GetLastInsertedId()'

This commit is contained in:
Alex Cabal 2025-03-10 11:04:20 -05:00
parent 4446b6d161
commit 5066252355
12 changed files with 44 additions and 57 deletions

View file

@ -39,11 +39,11 @@ class LocSubject{
public function Create(): void{
$this->Validate();
Db::Query('
$this->LocSubjectId = Db::QueryInt('
INSERT into LocSubjects (Name)
values (?)
returning LocSubjectId
', [$this->Name]);
$this->LocSubjectId = Db::GetLastInsertedId();
}
/**