Hello,
I need some help to search my database using a few variables.
I’m trying to search using a number between and a like option. I want to check the price between min and max and also where it’s held.
There’s a price field and a location in the database, there’s several different locations but all held under the same field name. Each product only has 1 location.
I tried...
$query = $modx->db->select("*", "modx_product", "price BETWEEN $min AND $max AND location LIKE '%$area%' ");
This hasn’t worked. Could someone help out with the correct format of the query please?
The reason I’m using LIKE wildcard is cause the DB is holding location that says ’& surrounding’ at the end of some options.
Thanks.