greater AND less than

C

CD

Guest
Hello,

I am having a small problem creating a certain search functionality with Dadabik. I have seen a few threads on this related to Date, but haven't had any luck finding a solution for my needs.

What I need to do is have the ability to search / display a range of numbers within a field.

For example, if I have a database of people, ages 10 - 30, with an age field listing each person's age. I'd like to be able to search for a group of people with two pull downs or two text boxes - one for the minimum age, one for the maximum age. These search criteria will always be different, so I need to use both a minimum and maximum.

Is there anyway to accomplish this? Any help would be greatly appreciated.

Thanks.

 
S

shawna

Guest
I implemented this in my own code.

I dont know if you are capable of editing php, but heres the rundown if you are.

In your search operators add \between on to the list.

edit business_logic.php after the section that says "case "less_then":"

Add

case "between":
$betweenvars = explode(" and ",$_POST[$field_name_temp]);
$where_clause .= $quote.$table_name.$quote.'.'.$quote.$field_name_temp.$quote." between '".$betweenvars[0]."' and '".$betweenvars[1]."'";


Youll also have to modify your language files. In english.php for example.

add "between" => "between",
in the normal messages section.

then you can select between when searching
and enter something like "10 and 100"

 
S

shawna

Guest
oh and i meant the second occurance of
"case "less_then":"

under default

the first is in the case "update_date": section DO NOT PUT IT THERE.
 
C

Chikka

Guest
Hi how do you implement this on a date min/max range search?
 
Top