update( sprintf( 'INSERT INTO paypal_transactions ( txn_id, txn_type, payer_email, receiver_email, item_number, payment_date, payer_id, receiver_id ) VALUES ( ?, ?, ?, ?, ?, %s, ?, ? )', $this->datetimeToDB($paymentDate) ), array( $txnId, $txnType, $payerEmail, $receiverEmail, $itemNumber, $payerId, $receiverId ) ); return true; } /** * Check whether a given transaction exists. * @param $txnId string * @return boolean */ function transactionExists($txnId) { $result =& $this->retrieve( 'SELECT count(*) FROM paypal_transactions WHERE txn_id = ?', array($txnId) ); $returner = false; if (isset($result->fields[0]) && $result->fields[0] >= 1) $returner = true; $result->Close(); return $returner; } } ?>