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
|
@ -95,7 +95,7 @@ class Payment{
|
|||
}
|
||||
|
||||
try{
|
||||
Db::Query('
|
||||
$this->PaymentId = Db::QueryInt('
|
||||
INSERT into Payments (UserId, Created, Processor, TransactionId, Amount, Fee, IsRecurring, IsMatchingDonation)
|
||||
values(?,
|
||||
?,
|
||||
|
@ -105,12 +105,11 @@ class Payment{
|
|||
?,
|
||||
?,
|
||||
?)
|
||||
returning PaymentId
|
||||
', [$this->UserId, $this->Created, $this->Processor, $this->TransactionId, $this->Amount, $this->Fee, $this->IsRecurring, $this->IsMatchingDonation]);
|
||||
}
|
||||
catch(Exceptions\DuplicateDatabaseKeyException){
|
||||
throw new Exceptions\PaymentExistsException();
|
||||
}
|
||||
|
||||
$this->PaymentId = Db::GetLastInsertedId();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue