Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Price range mod ???

Quote Reply
Price range mod ???
Hi. is there anyone who is using price range mod in DBMan SQL? i've tried to use it (because i do need it!) but it didn't work.

have a field as 'area'. in db.cgi, below

sub query {
# --------------------------------------------------------
# This routines does the actual search of the database.
#
my ($i, $column, @search_fields, @gt_fields, @lt_fields, $bool, $order, $sortby, $nh,
$where, $offset, $field, $field_q, $query, $userid_q, $sth, @tmp, @hits, $count, $comp);


i've added

$in{'area_range'} =~ s/,//g;
$in{'area_range'} =~ s/\+//g;
$in{'area_range'} =~ s/\$//g;
if ($in{'area_range'}) { @area = split /-/, $in{'area_range'};
$in{'area-gt'} = int($area[0]) - 1;
if ($area[1]) {
$in{'area-lt'} = int($area[1]) + 1;
}
}


but i am not sure if this is the right place. Then create a search form with

<SELECT NAME="area_range">
<option>50-100
<option>100-150
<option>150-200
<option>200+


then tried to search and got 0 matches. So i need your help

Best Regards





Quote Reply
Re: Price range mod ??? In reply to
OK i searched the forum and found a solution. 've changed the field type from VARCHAR to MEDIUMINT. Now I can search my database according to ranges. But when i attempt to add a new record, DBMan tries to give the same id no 10 to every record. In .cfg i have

$db_key = 'id'; # Column Name
$db_supply_key = 1; # 1 = supply a key, 0 = use your own.

I do really need help. anyone hear me?

Regards

Quote Reply
Re: Price range mod ??? In reply to
OK i'm the one who helped me!

i've just changed the field type of 'id' to INT and it's ok.

Regards