I am trying to get meta_value from postmeta using SQL select query, but it returns wc_order_h8K0C1ODu2134 instead of meta_value which is Table No 10
global $wpdb;
$order_id = $order->get_id();
$order_num = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id =
$order_id" ) );
echo $order_num->post_id; //which is 274 ok
echo $order_num->meta_value; // but meta_value retrun wc_order_h8K0C1ODu2134 and it should be Table No 10
I need to manipulate meta_value at thankyou page, eg. if the admin change Table No 10 to Table No 12 while the user is waiting for the admin response
but without having meta_value, I can't do that.
so how can I get meta_value which is Table No 10 (and not that wc_order_h8K0C1ODu2134)
I have tried different SQL techniques but it always returns wc_order_h8K0C1ODu2134.
Thanks
'; echo $order_num2 = meta_value;` here is finished code now its working fine. now i need to fetch data like every 5 second. with the help of this https://codex.wordpress.org/AJAX_in_Plugins not succeed yet. – user1781038 Nov 19 '21 at 00:12