Quantcast
Channel: Question and Answer » meta-query
Viewing all articles
Browse latest Browse all 36

Get result from meta_query() between two numbers

$
0
0

I have value like :-

    if ( ! empty( $_GET['filter-area'] ) ) {
        $f = $_GET['filter-area'];
        preg_match_all('!d+!', $f, $matches);
        foreach($matches as $key) {
        $first_val = $key[0];
        $second_val = $key[1];
        }
    }

Now i need to search to get all date between this two values.

So, I tried this way, but it take one value.

if ( ! empty( $_GET['filter-area'] ) ) {
    $meta[] = array(
        'key'       => REALIA_PROPERTY_PREFIX . 'attributes_area',
        'value'     => $first_val,
        'compare'   => '>=',
        'type'      => 'NUMERIC',
    );
}

How can search by tow value


Viewing all articles
Browse latest Browse all 36

Trending Articles