Skip to content

Commit 9147ab6

Browse files
committed
Updating the db record to allow the column selection
1 parent 026d63d commit 9147ab6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

includes/classes/class-helpers.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,17 +577,18 @@ public function get_the_user_ip() {
577577
* @param string $code
578578
* @return object
579579
*/
580-
public function get_db_record( $code ) {
580+
public function get_db_record( $code, $column = 'txn_code' ) {
581581
global $wpdb;
582582
$return = false;
583583
$table = $wpdb->prefix . PFF_PAYSTACK_TABLE;
584584
$record = $wpdb->get_results(
585585
$wpdb->prepare(
586586
"SELECT *
587587
FROM %i
588-
WHERE txn_code = %s"
588+
WHERE %i = %s"
589589
,
590590
$table,
591+
$column,
591592
$code
592593
), 'OBJECT' );
593594

0 commit comments

Comments
 (0)