Re: range vs greater than/less than
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 48331
interpreted = N
texte = This sounds like a job for the Group Field Workaround! Defining a groupfield that contains a field you're already searching lets you search that field again...[search db=...&group1field=ABC&leABCdata=[max]&geGROUP1data=[min]...]It's kinda ugly and tricker to write in a generic fashion, but it works.- brianOn Tuesday, March 4, 2003, at 01:46 PM, Andrew Simpson wrote:> This is just a comment really on the way webcat does something that i > don't> like.>> I have just finished writing a search page that lets you select from > drop> down lists to refine your search. The company sells projectors. The > search> criteria are>> min / max price> min / max resolution> min / max weight> min / max lumens (brightness)>> with a drop down for both min and max values for each item.>> You select your mins and maxiums and hopefully you get a set of > products> returned that are within the range.>> So I wrote some nice generic code that should handle all > eventuallities:>> [formvariables name=min&exact=false]> [showif [value]!#]> [text]search_string=[search_string]ge[getchars> start=5][name][/getchars]data=[value]&[getchars> start=5][name][/getchars]type=num&[/text]> [/showif]> [/formvariables]>> [formvariables name=max&exact=false]> [showif [value]!#]> [text]search_string=[search_string]le[getchars> start=5][name][/getchars]data=[value]&[getchars> start=5][name][/getchars]type=num&[/text]> [/showif]> [/formvariables]>> So depending on how many options the user chooses, the search_string > slowly> gets built up to the point where you run it and the found items loop > does> the rest. It works great if you only select a min for one field or a > max for> one field>> BUT IT DOESN'T WORK IF YOU SELECT BOTH MIN AND MAX FROM ONE FIELD!>> Because of the way webcat works with Ranges when comparing multiple > values> on the same field of the database, this code is toast and now i have to> write some not so nice generic code to handle the same search job.>> Argh!>> okay - sorry, i didn't get much sleep last night.-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
This sounds like a job for the Group Field Workaround! Defining a groupfield that contains a field you're already searching lets you search that field again...[search db=...&group1field=ABC&leABCdata=[max]&geGROUP1data=[min]...]It's kinda ugly and tricker to write in a generic fashion, but it works.- brianOn Tuesday, March 4, 2003, at 01:46 PM, Andrew Simpson wrote:> This is just a comment really on the way webcat does something that i > don't> like.>> I have just finished writing a search page that lets you select from > drop> down lists to refine your search. The company sells projectors. The > search> criteria are>> min / max price> min / max resolution> min / max weight> min / max lumens (brightness)>> with a drop down for both min and max values for each item.>> You select your mins and maxiums and hopefully you get a set of > products> returned that are within the range.>> So I wrote some nice generic code that should handle all > eventuallities:>> [formvariables name=min&exact=false]> [showif [value]!#]> [text]search_string=[search_string]ge[getchars> start=5][name][/getchars]data=[value]&[getchars> start=5][name][/getchars]type=num&[/text]> [/showif]> [/formvariables]>> [formvariables name=max&exact=false]> [showif [value]!#]> [text]search_string=[search_string]le[getchars> start=5][name][/getchars]data=[value]&[getchars> start=5][name][/getchars]type=num&[/text]> [/showif]> [/formvariables]>> So depending on how many options the user chooses, the search_string > slowly> gets built up to the point where you run it and the found items loop > does> the rest. It works great if you only select a min for one field or a > max for> one field>> BUT IT DOESN'T WORK IF YOU SELECT BOTH MIN AND MAX FROM ONE FIELD!>> Because of the way webcat works with Ranges when comparing multiple > values> on the same field of the database, this code is toast and now i have to> write some not so nice generic code to handle the same search job.>> Argh!>> okay - sorry, i didn't get much sleep last night.-- Brian Fries, BrainScan Software -- http://www.brainscansoftware.com ---------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WARNING: deletedb anomaly (2002)
Updating fields from different platforms (1998)
More than one db with the same namn (was: WC2f3) (1997)
webdna code shows on .htm extensions. (2000)
[WebDNA] CICADA Install problems on Linux (2009)
Frames and WebCat (1997)
Re[2]: Re[2]: Bugs still *not* fixed as promised ... (2000)
shipcost (1997)
Can this be done? (1997)
Authorize.Net down 2 days in row (2004)
all records returned. (1997)
Interfacing WebMerchant to www.fedex.com (1997)
WCS Newbie question (1997)
[WebDNA] grep again (2010)
Running subtotal? (1998)
Shipcost update problem (1997)
Simple way to create unique SKU (1997)
Where's Cart Created ? (1997)
Help with [search] sort (2003)
Emailer Question (1998)