mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 14:50:39 -04:00
Use exists() for some SQL statements; send thank-you email to patron donors who donate again
This commit is contained in:
parent
a4910b8d67
commit
a442f92e28
3 changed files with 41 additions and 19 deletions
|
@ -52,14 +52,16 @@ $faItemsPerPage = 20; // How many items are on a full page of FA results?
|
|||
// If /tmp/last-fa-donation doesn't exist, get all transactions from today and create the file.
|
||||
|
||||
function InsertTransaction($transactionId){
|
||||
$exists = Db::QueryInt('SELECT count(*)
|
||||
from
|
||||
( select 1
|
||||
from Payments
|
||||
where TransactionId = ?
|
||||
union select 1
|
||||
from PendingPayments
|
||||
where TransactionId = ? ) x',
|
||||
$exists = Db::QueryInt('SELECT exists(
|
||||
select *
|
||||
from
|
||||
( select 1
|
||||
from Payments
|
||||
where TransactionId = ?
|
||||
union select 1
|
||||
from PendingPayments
|
||||
where TransactionId = ? ) x
|
||||
)',
|
||||
[$transactionId, $transactionId]);
|
||||
|
||||
if(!$exists){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue