Gossamer Forum
Home : Products : DBMan : Installation :

-gt and -lt problem...

Quote Reply
-gt and -lt problem...
Hi,
I have setup a searching routine, based on the record_long display. When a user check a checkbox, thats after a field and the user clicks on the 'submit' button, the script search the db. for matching records, whitch match with the value of the field near the checkbox. What my problem is, I will load one checkbox value, that is 10% lower as the field near, and also another, that is 10% greater. It must feed the searching routine. The values of the fields are 'numer'. I tried it this way, but without succes. Whats wrong???
It stand near the field with has the value '$rec{'Kmstand'}'.
Code:
|;
if ($rec{'Kmstand-gt'}) {
$rec{'Kmstand-lt'} = $rec{'Kmstand-gt'} + ($rec{'Kmstand-gt'} / 10) ; }
print qq|
Quote Reply
Re: -gt and -lt problem... In reply to
But the searching is now focus on 'Range' and not on 'Kmstand-gt' and 'Kmstand-lt', I saw that in the search-URL: http://www.autorandstad.nl/cgi-bin/dbman/db.cgi?db=default&uid=default&Range=117000&view_records=GO
Quote Reply
Re: -gt and -lt problem... In reply to
It doesn't matter. If you add the code to sub query, it will create -gt and -lt search terms within the script.


------------------
JPD





Quote Reply
Re: -gt and -lt problem... In reply to
OK, its just the cut&paste thing, I found a typo in your code. Now its working!!! Smile

Thanks
-------
Mart.
Quote Reply
Re: -gt and -lt problem... In reply to
Yep. I see it now too. Smile

Glad it works for you.


------------------
JPD




[This message has been edited by JPDeni (edited August 15, 1999).]
Quote Reply
Re: -gt and -lt problem... In reply to
Your explanation is a little fuzzy, but I'll try to answer your question.

Seems to me that the way to do this would be to name the field something completely different and then assign the values for "-gt" and "-lt" in sub query.

If, for example, you set up your checkbox like

<input type="checkbox" name="Range" value="$rec{'Kmstand'}">

Then, in sub query, right near the beginning, you would add

Code:
if ($in{'Range'}) {
$in{'Kmstand-gt'} = $in{'Range'} - ($in{'Range'}/10);
$in{'Kmstand-lt'} = $in{'Range'} + ($in{'Range'}/10);
}

Seems to me that it would work.



------------------
JPD







[This message has been edited by JPDeni (edited August 12, 1999).]