I have a meta_query that gets all the items with a price range between 2 variables. My problem is that 10 000 is not the same as 10000. How can I fix this?
I have been googling but I’n not sure what to google so I’m not really getting anywhere.
Help would be appreciated
Thanks
Hanè
Edit – Code Added
$kw_min = mysql_real_escape_string($_GET['kw_min']);
$kw_max = mysql_real_escape_string($_GET['kw_max']);
$pr_min = mysql_real_escape_string($_GET['pr_min']);
$pr_max = mysql_real_escape_string($_GET['pr_max']);
if ( !empty( $kw_min ) && !empty( $kw_max ) && !empty( $pr_min ) && !empty( $pr_max ) ) {
$args = array(
'post_type' => 'exc_agriq_equipment',
'exc_equipment_cat' => $term->slug,
'order' => 'DESC',
'posts_per_page' => 12,
'paged'=>$paged,
'meta_query' => array(
array(
'key' => 'exc_agriq_equipment_kw',
'value' => array( $kw_min, $kw_max ),
'type' => 'numeric',
'compare' => 'BETWEEN'
),
array(
'key' => 'exc_agriq_equipment_price',
'value' => array( $pr_min, $pr_max ),
'type' => 'numeric',
'compare' => 'BETWEEN'
),
),
);
}