Meta_query compare between two values (1 post)

  1. Jeffrey van Rossum
    Posted 2 years ago #

    I'm using a query to check if the price of a product falls within a certain range. This works with the code below, until I use a zero value to compare from.

    	'relation' => 'OR',
    	   array('key' => 'buyprice'),
    	   array('key' => 'rentalprice'),
    	'value' => array( $_GET['price_start'], $_GET['price_end'] ),
    	'compare' => 'BETWEEN',
    	'type' => 'UNSIGNED'

    How can I get this to work when the 'price_start' value is 0? Hoping for help.

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by Jeffrey van Rossum
  • This topic is not resolved
  • WordPress version: 3.7.1