mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Use 'insert ... returning' instead of 'Db::GetLastInsertedId()'
This commit is contained in:
parent
4446b6d161
commit
5066252355
12 changed files with 44 additions and 57 deletions
|
@ -268,14 +268,13 @@ class Artist{
|
|||
*/
|
||||
public function Create(): void{
|
||||
$this->Validate();
|
||||
Db::Query('
|
||||
$this->ArtistId = Db::QueryInt('
|
||||
INSERT into Artists (Name, UrlName, DeathYear)
|
||||
values (?,
|
||||
?,
|
||||
?)
|
||||
returning ArtistId
|
||||
', [$this->Name, $this->UrlName, $this->DeathYear]);
|
||||
|
||||
$this->ArtistId = Db::GetLastInsertedId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue