Ampersand is breaking search context

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 22703
interpreted = N
texte = Hello, I'm still having trouble understanding what exactly is happening when an & (ampersand) is in a db field. I have a db that has sku,type,artist, and title as it's field names. I do a search for an sku to find a unique product: [search db=Catalog.db&eqskudata=250980211&cart=2999507845187] [founditems]Which brings up a product listing. Within that founditems loop, I do another search to find matching [artist] and [title] records with different [sku] numbers:[search db=Catalog.db&eqArtistdatarq=[Artist]&eqTitledatarq=[Title]]This product is available in the following product types:
[founditems] [sku], [type]
[/founditems][/search] [/founditems] [/search]This works fine and finds the matching records until an ampersand is present in the [artist] field for that record. The inner search then finds no matches. If I update the database by substituting the word and for the ampersand, the search works again. If I wrap the [Artist] and [Title] in a [url] context, like: [search db=Catalog.db&eqArtistdatarq=[url][Artist][/url]&eqTitledatarq=[url][Title][ /url]] The search still finds no match. The really baffling thing is, the ampersand is in the [Artist] field and yet if I leave the [Artist] criteria out of the search: [search db=Catalog.db&eqTitledatarq=[Title]] (with or without the [url] wrap) The search still finds no match. Again, if I remove the ampersand from the [Artist] field of the database and use the above search, it finds the matching records, even though I am not using the [Artist] field as part of the search. I have read through the talklist archive and have seen discussion that it is usually the browser that has difficulty with the ampersand but this is happening strictly within *contexts* so the browser has no part in it.So, How do I A: Properly create a form that allows a user to enter a name like Meyer & Frank into a text field that will be appended to my database, and B: Properly construct a search like the above to then find the record that contains the ampersand character.Is there a comprehensive discussion on this subject somewhere in the documentation? If not, I think it would be a welcome addition, considering how many records come up on the subject when searching the talklist archive. Thanks, Mike Davis Associated Messages, from the most recent to the oldest:

    
  1. Re: Ampersand is breaking search context (Mike_Davis 1999)
  2. Re: Ampersand is breaking search context (Kenneth Grome 1999)
  3. Ampersand is breaking search context (Mike_Davis 1999)
Hello, I'm still having trouble understanding what exactly is happening when an & (ampersand) is in a db field. I have a db that has sku,type,artist, and title as it's field names. I do a search for an sku to find a unique product: [search db=Catalog.db&eqskudata=250980211&cart=2999507845187] [founditems]Which brings up a product listing. Within that founditems loop, I do another search to find matching [artist] and [title] records with different [sku] numbers:[search db=Catalog.db&eqArtistdatarq=[Artist]&eqTitledatarq=[Title]]This product is available in the following product types:
[founditems] [sku], [type]
[/founditems][/search] [/founditems] [/search]This works fine and finds the matching records until an ampersand is present in the [artist] field for that record. The inner search then finds no matches. If I update the database by substituting the word and for the ampersand, the search works again. If I wrap the [Artist] and [Title] in a [url] context, like: [search db=Catalog.db&eqArtistdatarq=[url][Artist][/url]&eqTitledatarq=[url][Title][ /url]] The search still finds no match. The really baffling thing is, the ampersand is in the [Artist] field and yet if I leave the [Artist] criteria out of the search: [search db=Catalog.db&eqTitledatarq=[Title]] (with or without the [url] wrap) The search still finds no match. Again, if I remove the ampersand from the [Artist] field of the database and use the above search, it finds the matching records, even though I am not using the [Artist] field as part of the search. I have read through the talklist archive and have seen discussion that it is usually the browser that has difficulty with the ampersand but this is happening strictly within *contexts* so the browser has no part in it.So, How do I A: Properly create a form that allows a user to enter a name like Meyer & Frank into a text field that will be appended to my database, and B: Properly construct a search like the above to then find the record that contains the ampersand character.Is there a comprehensive discussion on this subject somewhere in the documentation? If not, I think it would be a welcome addition, considering how many records come up on the subject when searching the talklist archive. Thanks, Mike Davis Mike_Davis

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:

RE: Nesting [ListFiles] (1998) UPS charges (2000) Using files in an Email broadcast (1999) Browser Problem?!? POST forms and NN 4.0+ browsers (1997) Help name our technology! I found it (1997) Multiple SSL Keys (1998) How to verify email address (1997) Date search - yes or no (1997) WC on Mac OS X or Mac OS X Server 2.x (2001) WebCat2b13 Command Reference Doc error (1997) Passing variables to Realm Authentication - WebStar (1998) Summ (1998) RedHat Linux glibc version 2.1.2 or higher required (2000) New Server? (2006) REPOST: How do _you_ back up your db? (2000) RE: Formulas.db + Users.db (1997) html delivery (1997) PCS Emailer's role ? (1997) can webcat create directories on NT? (1997) DataBaseHelper Flawed (1997)