I want to all records from my postmeta table where meta_key = ‘teljesitmeny’ and meta_value between 0 and 150.
I make this query, but it’s not working:
$argsg = array(
'post_type' => 'termek',
'meta_query' => array(
array(
'key' => 'teljesitmeny',
'value' => array(0, 150),
'compare' => 'BETWEEN'
),
),
);
$scheduled = '';
$scheduled = new WP_Query( $argsg );
It’s only post one query, where meta_value is 150.
Datas in postmeta table:
Datas after execute the query:
What did i wrong?
Update:
I found the solution:
SELECT *
FROM `eopwrqjnc_postmeta`
WHERE `meta_key` LIKE 'teljesitmeny'
AND `meta_value`
BETWEEN CAST( 0 AS UNSIGNED )
AND CAST( 150 AS UNSIGNED )
LIMIT 0 , 30