I am trying to get payment_transaction_id but it doesn't work. Same code works to get info from users, I didn't understand why couldn't get the data.
This is how table created(which is working and has data in it already).
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta($sql);
$table_name2 = $wpdb->prefix . 'iyzico_order_refunds';
$sql = "CREATE TABLE $table_name2 (
iyzico_order_refunds_id INT(11) NOT NULL AUTO_INCREMENT,
order_id INT(11) NOT NULL,
item_id INT(11) NOT NULL,
payment_transaction_id INT(11) NOT NULL,
paid_price VARCHAR(50),
total_refunded VARCHAR(50),
PRIMARY KEY (iyzico_order_refunds_id)
) $charset_collate;";
dbDelta($sql);
And I am trying to pull transaction ID with this:
$payment_transaction_id = $wpdb->get_var( "SELECT payment_transaction_id FROM $wpdb->iyzico_order_refunds WHERE order_id=769 AND item_id=760" );
What am I doing wrong?
{$wpdb->prefix}iyzico_order_refundsinstead of$wpdb->iyzico_order_refunds.