WordPress.org

Ready to get started?Download WordPress

Forums

Meta_query compare between two values (1 post)

  1. jeffreyvr
    Member
    Posted 9 months 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.

    array(
    	'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.

Reply

You must log in to post.

About this Topic