Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isaDupe($portableDB, $transactArray)
- {
- $ref = $transactArray["reference"];
- $date = $transactArray["qdate"];
- $time = $transactArray["time"];
- //prints the query so I can run by hand to test
- print "SELECT `counter` FROM transactions WHERE (`reference` = '$ref' AND `qdate` = '$date' AND `time` = '$time') ";
- if ($dupeSelectStmt = $portableDB->prepare("SELECT `counter` FROM transactions WHERE (`reference` = ? AND `qdate` = ? AND `time` = ?)"))
- {
- $dupeSelectStmt->bind_param('sss',$ref, $date, $time);
- $dupeSelectStmt->bind_result($counter);
- $dupeSelectStmt->execute();
- while ($dupeSelectStmt->fetch())
- {
- break;
- }
- $numRows = $portableDB->affected_rows;
- if ($numRows > 0)
- return TRUE;
- else if ($numRows == -1)
- {
- print " ERROR: ";
- print_r($portableDB->error);
- print_r($dupeSelectStmt->error);
- return FALSE;
- }
- else
- return FALSE;
- }
- }
Add Comment
Please, Sign In to add comment