range vs greater than/less than

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 48330
interpreted = N
texte = 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 aremin / 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 fieldBUT 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. ------------------------------------------------------------- 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:

    
  1. Re: range vs greater than/less than (Alain Russell 2003)
  2. Re: range vs greater than/less than (Brian Fries 2003)
  3. Re: range vs greater than/less than (Andrew Simpson 2003)
  4. Re: range vs greater than/less than (Brian Fries 2003)
  5. Re: range vs greater than/less than (Andrew Simpson 2003)
  6. Re: range vs greater than/less than (Andrew Simpson 2003)
  7. Re: range vs greater than/less than (Brian Fries 2003)
  8. range vs greater than/less than (Andrew Simpson 2003)
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 aremin / 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 fieldBUT 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. ------------------------------------------------------------- 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/ Andrew Simpson

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:

WCS Newbie question (1997) Shop from PDF (2004) 2.1 release (1998) Search design (1997) WebCommerce: Folder organization ? (1997) help (2000) cart info (1998) Some Questions (1997) [table] weirdness (2003) [searchString] (1997) [showif] results returned... (2003) WebCat with WebTen (1998) carriage returns in data (1997) Can I invoke an ssi plugin from within a webcat page (1997) numfound question (2005) emailer (1997) Passing Cart variable to subdirectory files? (1997) Resume Catalog ? (1997) strangness with the form