Re: [WebDNA] Search on a database

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 108754
interpreted = N
texte = --Apple-Mail-5-234903704 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > here's the code I had tried: >=20 > = __________________________________________________________________________= _____________________________ >=20 > admin.tpl >=20 > [Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqtheDatedata= rq=3D[date][!] > = [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&design=3D[_design][!]= > = [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[url][_visitorC= ity][/url]&email=3D[url][_email] ] > =20 >=20 > =09 > [founditems] > Visitor ID: [visitorUniqueID]
> Date: [date]
> Time: [time]
> Learn more? [_learnMore]
> Irrigation Design? [_design]
> Name: [_visitorName]
> City: [_visitorCity]
> email: [_email]
>=20 > =09 > [/founditems] > =20 > [/search] > =20 > = __________________________________________________________________________= _________________________________________ >=20 > I was getting a blank page with this code. That's why I figured I = wasn't grabbing each individual person's entry correctly. > After I looked this over again, I had a look at the code you offered = me. It's quite a different approach than I had imagined. I will study = this code very carefully. Thank you so much, again for your offerings.=20= >=20 > Lori Hi Lori Don't mind that I brought this back on list. I am not being mean or = showing off; this is standard procedure, honest. ; people just want to = see and learn and help. If you want to use code that you wrote yourself, instead of what I = offered.. then good; that is better! Do keep trying! When I look at your code, the immediate ideas I have are: - add "numfound=3D[numfound]" somewhere inside the = [search]...[/search] so you can verify that the search is indeed being = parsed, but just finding zero records (or else it will show how many = records it finds). - look again at your [search] criteria (parameters). =20 You are effectively telling the search to only find those records where: db=3DvisitorSurvey2.db AND both of these criteria are met: &eqvisitorIDdatarq=3D[visitorUniqueID] &eqtheDatedatarq=3D[date] AND this criteria might be met: &eqtheTimedata=3D[time] . Note that these criteria should be ignored by the [search], because they = are not formed properly (bad syntax): &learnMore=3D[_learnMore] &design=3D[_design] &visitorName=3D[url][_visitorName][/url] &visitorCity=3D[url][_visitorCity][/url] &email=3D[url][_email]=20 If you had wanted to require any found records to have a certain value = for the [email] field, for example, then the syntax for that search = parameter would be like so: &eqemaildata=3D[url][_email][/url]=20 ...or: &eqemaildatarq=3D[url][_email][/url]=20 ...but NOT: &email=3D[url][_email]=20 Anyway, once you decide which field(s') values you want to check, as you = decide which records to find with your search, and you get the syntax = right (check the docs), then the next thing to consider is: what are the = values for all those variables? (i.e. what are the values for: = [visitorUniqueID], [_learnMore], [_design], [_visitorName], = [_visitorCity], [_email], on a given page load ?) Are those variables supposed to be populated from a form submission? Or = from URL parameters? Or how? =20 One way to check what the [search] tries to do on a given page load, is = to place a copy of the same search code alongside the real code, but = with the square brackets replaced with pipes (the vertical bar = character) or something.. like for example, place this on your page, = and try it again: > |Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqtheDatedata= rq=3D[date][!] > = [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&design=3D[_design][!]= > = [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[url][_visitorC= ity][/url]&email=3D[url][_email] | > =20 > |founditems| > Visitor ID: [visitorUniqueID]
> Date: [date]
> Time: [time]
> Learn more? [_learnMore]
> Irrigation Design? [_design]
> Name: [_visitorName]
> City: [_visitorCity]
> email: [_email]
> |/founditems| > =20 > |/search| ...then you can actually see what is being stuck into those variables = which the search criteria is comparing against. What shows on the page when you try that? It seems odd that on the one hand you just want to see peoples' survey = responses (what people have submitted using your survey form), but on = the other hand to find those records your code is potentially checking = ALL those various fields. Don't you just want to see all the records = submitted on a given day (or in a given date range)? If so, then why = make your search check to see what is in the [name] field .. or in the = [email] field, etc.? The code you just showed (if it had proper syntax) = as if means to only find records with a certain value in EVERY single = field. (!?) ...well if you already know the exact value for every = field, then why even bother searching for that record? I assume you = really meant to search for records where just ONE of the fields equals a = certain value (like where the date is yesterday, for example = ("...&eqtheDatedatarq=3D[showResponsesOnThisDate]...")). Keep at it.. and keep asking questions. It gets clear with practice. = Keep admitting blind spots in your understanding of the code, where they = are.. then we can know to put more attention and shed more light there. - Govinda= --Apple-Mail-5-234903704 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
here's the code I had = tried:

____________________________________________________________= ___________________________________________

admin.tpl

 = [Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqthe= Datedatarq=3D[date][!]
  =  [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&des= ign=3D[_design][!]
  =  [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[= url][_visitorCity][/url]&email=3D[url][_email] = ]
  


[founditems]
= Visitor ID: [visitorUniqueID]<br>
= Date: [date]<br>
Time: = [time]<br>
Learn more? = [_learnMore]<br>
Irrigation Design? = [_design]<br>
Name: = [_visitorName]<br>
City: = [_visitorCity]<br>
email: = [_email]<br>

=
[/founditems]
  
  = [/search]
 
___________________________________________________= ________________________________________________________________

I = was getting a blank page with this code. That's why I figured I wasn't = grabbing each individual person's entry correctly.
After I looked = this over again, I had a look at the code you offered me. It's quite a = different approach than I had imagined. I will study this code very = carefully. Thank you so much, again for = your offerings. 

Lori


=
Hi Lori

Don't mind that I brought = this back on list.  I am not being mean or showing off; this is = standard procedure, honest.  ;  people just want to see and = learn and help.

If you want to use code that = you wrote yourself, instead of what I offered.. then good; that is = better!  Do keep trying!

When I look at = your code, the immediate ideas I have are:

- = add  "numfound=3D[numfound]"  somewhere inside the = [search]...[/search] so you can verify that the search is indeed being = parsed, but just finding zero records (or else it will show how many = records it finds).
- look again at your [search] criteria = (parameters).  

You are effectively = telling the search to only find those records = where:

db=3DvisitorSurvey2.db

A= ND both of these criteria are met:

&eqvisitorIDdatarq=3D[visitorUniqueID]
&eqthe= Datedatarq=3D[date]

AND this criteria might be = met:

&eqtheTimedata=3D[time]
.

Note that these criteria should be ignored by the [search], = because they are not formed properly (bad = syntax):

&learnMore=3D[_learnMore]
&design=3D[_design]=
&visitorName=3D[url][_visitorName][/url]
&visitorCity=3D[ur= l][_visitorCity][/url]
&email=3D[url][_email] 

If you had wanted to require any found = records to have a certain value for the [email] field, for example, then = the syntax for that search parameter would be like = so:
&eqemaildata=3D[url][_email][/url] 

...or:
&eqemaildatarq=3D[url][_email][/url] 

...but = NOT:
&email=3D[url][_email] 

Anyway, once you decide which field(s') values you want = to check, as you decide which records to find with your search, and you = get the syntax right (check the docs), then the next thing to consider = is: what are the values for all those variables?  (i.e. what = are the values = for: [visitorUniqueID], [_learnMore], [_design], [_vis= itorName], [_visitorCity], [_email], on a given page load = ?)
Are those variables supposed to be populated from = a form submission?  Or from URL parameters?  Or how? =  
One way to check what the [search] tries to do on a = given page load, is to place a copy of the same search code alongside = the real code, but with the square brackets replaced with pipes (the = vertical bar character) or something..  like for example, place = this on your page, and try it = again:

 |Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqthe= Datedatarq=3D[date][!]
  =  [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&des= ign=3D[_design][!]
  =  [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[= url][_visitorCity][/url]&email=3D[url][_email] = |
  
|founditems|
= Visitor ID: [visitorUniqueID]<br>
= Date: [date]<br>
Time: = [time]<br>
Learn more? [_learnMore]<br>
= Irrigation Design? [_design]<br>
= Name: [_visitorName]<br>
City: = [_visitorCity]<br>
email: = [_email]<br>
= |/founditems|
  
  = |/search|

...then you can actually = see what is being stuck into those variables which the search criteria = is comparing against.
What shows on the page when you try = that?


It seems odd that on the = one hand you just want to see peoples' survey responses (what people = have submitted using your survey form), but on the other hand to find = those records your code is potentially checking ALL those various = fields.  Don't you just want to see all the records submitted on a = given day (or in a given date range)?  If so, then why make your = search check to see what is in the [name] field .. or in the [email] field, = etc.?  The code you just showed (if it had proper syntax) as if = means to only find records with a certain value in EVERY single field. = (!?)  ...well if you already know the exact value for every field, = then why even bother searching for that record?  I assume you = really meant to search for records where just ONE of the fields equals a = certain value (like where the date is yesterday, for example ("...&eqtheDatedatarq=3D[showResponsesOnThisDate]...")).

Keep at it.. and keep asking questions. =  It gets clear with practice.  Keep admitting blind spots in = your understanding of the code, where they are.. then = we can know to put more attention and shed more light = there.

- Govinda
= --Apple-Mail-5-234903704-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Search on a database (Govinda 2012)
  2. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  3. Re: [WebDNA] Search on a database (Govinda 2012)
  4. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  5. Re: [WebDNA] Search on a database (Govinda 2012)
  6. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  7. Re: [WebDNA] Search on a database (Govinda 2012)
  8. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  9. Re: [WebDNA] Search on a database (Govinda 2012)
  10. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  11. Re: [WebDNA] Search on a database (Govinda 2012)
  12. Re: [WebDNA] Search on a database (Govinda 2012)
  13. Re: [WebDNA] Search on a database (Lori Palmquist 2012)
  14. Re: [WebDNA] Search on a database (Govinda 2012)
  15. Re: [WebDNA] Search on a database (aaronmichaelmusic@gmail.com 2012)
  16. [WebDNA] Search on a database (Lori Palmquist 2012)
--Apple-Mail-5-234903704 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > here's the code I had tried: >=20 > = __________________________________________________________________________= _____________________________ >=20 > admin.tpl >=20 > [Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqtheDatedata= rq=3D[date][!] > = [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&design=3D[_design][!]= > = [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[url][_visitorC= ity][/url]&email=3D[url][_email] ] > =20 >=20 > =09 > [founditems] > Visitor ID: [visitorUniqueID]
> Date: [date]
> Time: [time]
> Learn more? [_learnMore]
> Irrigation Design? [_design]
> Name: [_visitorName]
> City: [_visitorCity]
> email: [_email]
>=20 > =09 > [/founditems] > =20 > [/search] > =20 > = __________________________________________________________________________= _________________________________________ >=20 > I was getting a blank page with this code. That's why I figured I = wasn't grabbing each individual person's entry correctly. > After I looked this over again, I had a look at the code you offered = me. It's quite a different approach than I had imagined. I will study = this code very carefully. Thank you so much, again for your offerings.=20= >=20 > Lori Hi Lori Don't mind that I brought this back on list. I am not being mean or = showing off; this is standard procedure, honest. ; people just want to = see and learn and help. If you want to use code that you wrote yourself, instead of what I = offered.. then good; that is better! Do keep trying! When I look at your code, the immediate ideas I have are: - add "numfound=3D[numfound]" somewhere inside the = [search]...[/search] so you can verify that the search is indeed being = parsed, but just finding zero records (or else it will show how many = records it finds). - look again at your [search] criteria (parameters). =20 You are effectively telling the search to only find those records where: db=3DvisitorSurvey2.db AND both of these criteria are met: &eqvisitorIDdatarq=3D[visitorUniqueID] &eqtheDatedatarq=3D[date] AND this criteria might be met: &eqtheTimedata=3D[time] . Note that these criteria should be ignored by the [search], because they = are not formed properly (bad syntax): &learnMore=3D[_learnMore] &design=3D[_design] &visitorName=3D[url][_visitorName][/url] &visitorCity=3D[url][_visitorCity][/url] &email=3D[url][_email]=20 If you had wanted to require any found records to have a certain value = for the [email] field, for example, then the syntax for that search = parameter would be like so: &eqemaildata=3D[url][_email][/url]=20 ...or: &eqemaildatarq=3D[url][_email][/url]=20 ...but NOT: &email=3D[url][_email]=20 Anyway, once you decide which field(s') values you want to check, as you = decide which records to find with your search, and you get the syntax = right (check the docs), then the next thing to consider is: what are the = values for all those variables? (i.e. what are the values for: = [visitorUniqueID], [_learnMore], [_design], [_visitorName], = [_visitorCity], [_email], on a given page load ?) Are those variables supposed to be populated from a form submission? Or = from URL parameters? Or how? =20 One way to check what the [search] tries to do on a given page load, is = to place a copy of the same search code alongside the real code, but = with the square brackets replaced with pipes (the vertical bar = character) or something.. like for example, place this on your page, = and try it again: > |Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqtheDatedata= rq=3D[date][!] > = [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&design=3D[_design][!]= > = [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[url][_visitorC= ity][/url]&email=3D[url][_email] | > =20 > |founditems| > Visitor ID: [visitorUniqueID]
> Date: [date]
> Time: [time]
> Learn more? [_learnMore]
> Irrigation Design? [_design]
> Name: [_visitorName]
> City: [_visitorCity]
> email: [_email]
> |/founditems| > =20 > |/search| ...then you can actually see what is being stuck into those variables = which the search criteria is comparing against. What shows on the page when you try that? It seems odd that on the one hand you just want to see peoples' survey = responses (what people have submitted using your survey form), but on = the other hand to find those records your code is potentially checking = ALL those various fields. Don't you just want to see all the records = submitted on a given day (or in a given date range)? If so, then why = make your search check to see what is in the [name] field .. or in the = [email] field, etc.? The code you just showed (if it had proper syntax) = as if means to only find records with a certain value in EVERY single = field. (!?) ...well if you already know the exact value for every = field, then why even bother searching for that record? I assume you = really meant to search for records where just ONE of the fields equals a = certain value (like where the date is yesterday, for example = ("...&eqtheDatedatarq=3D[showResponsesOnThisDate]...")). Keep at it.. and keep asking questions. It gets clear with practice. = Keep admitting blind spots in your understanding of the code, where they = are.. then we can know to put more attention and shed more light there. - Govinda= --Apple-Mail-5-234903704 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
here's the code I had = tried:

____________________________________________________________= ___________________________________________

admin.tpl

 = [Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqthe= Datedatarq=3D[date][!]
  =  [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&des= ign=3D[_design][!]
  =  [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[= url][_visitorCity][/url]&email=3D[url][_email] = ]
  


[founditems]
= Visitor ID: [visitorUniqueID]<br>
= Date: [date]<br>
Time: = [time]<br>
Learn more? = [_learnMore]<br>
Irrigation Design? = [_design]<br>
Name: = [_visitorName]<br>
City: = [_visitorCity]<br>
email: = [_email]<br>

=
[/founditems]
  
  = [/search]
 
___________________________________________________= ________________________________________________________________

I = was getting a blank page with this code. That's why I figured I wasn't = grabbing each individual person's entry correctly.
After I looked = this over again, I had a look at the code you offered me. It's quite a = different approach than I had imagined. I will study this code very = carefully. Thank you so much, again for = your offerings. 

Lori


=
Hi Lori

Don't mind that I brought = this back on list.  I am not being mean or showing off; this is = standard procedure, honest.  ;  people just want to see and = learn and help.

If you want to use code that = you wrote yourself, instead of what I offered.. then good; that is = better!  Do keep trying!

When I look at = your code, the immediate ideas I have are:

- = add  "numfound=3D[numfound]"  somewhere inside the = [search]...[/search] so you can verify that the search is indeed being = parsed, but just finding zero records (or else it will show how many = records it finds).
- look again at your [search] criteria = (parameters).  

You are effectively = telling the search to only find those records = where:

db=3DvisitorSurvey2.db

A= ND both of these criteria are met:

&eqvisitorIDdatarq=3D[visitorUniqueID]
&eqthe= Datedatarq=3D[date]

AND this criteria might be = met:

&eqtheTimedata=3D[time]
.

Note that these criteria should be ignored by the [search], = because they are not formed properly (bad = syntax):

&learnMore=3D[_learnMore]
&design=3D[_design]=
&visitorName=3D[url][_visitorName][/url]
&visitorCity=3D[ur= l][_visitorCity][/url]
&email=3D[url][_email] 

If you had wanted to require any found = records to have a certain value for the [email] field, for example, then = the syntax for that search parameter would be like = so:
&eqemaildata=3D[url][_email][/url] 

...or:
&eqemaildatarq=3D[url][_email][/url] 

...but = NOT:
&email=3D[url][_email] 

Anyway, once you decide which field(s') values you want = to check, as you decide which records to find with your search, and you = get the syntax right (check the docs), then the next thing to consider = is: what are the values for all those variables?  (i.e. what = are the values = for: [visitorUniqueID], [_learnMore], [_design], [_vis= itorName], [_visitorCity], [_email], on a given page load = ?)
Are those variables supposed to be populated from = a form submission?  Or from URL parameters?  Or how? =  
One way to check what the [search] tries to do on a = given page load, is to place a copy of the same search code alongside = the real code, but with the square brackets replaced with pipes (the = vertical bar character) or something..  like for example, place = this on your page, and try it = again:

 |Search = db=3DvisitorSurvey2.db&eqvisitorIDdatarq=3D[visitorUniqueID]&eqthe= Datedatarq=3D[date][!]
  =  [/!]&eqtheTimedata=3D[time]&learnMore=3D[_learnMore]&des= ign=3D[_design][!]
  =  [/!]&visitorName=3D[url][_visitorName][/url]&visitorCity=3D[= url][_visitorCity][/url]&email=3D[url][_email] = |
  
|founditems|
= Visitor ID: [visitorUniqueID]<br>
= Date: [date]<br>
Time: = [time]<br>
Learn more? [_learnMore]<br>
= Irrigation Design? [_design]<br>
= Name: [_visitorName]<br>
City: = [_visitorCity]<br>
email: = [_email]<br>
= |/founditems|
  
  = |/search|

...then you can actually = see what is being stuck into those variables which the search criteria = is comparing against.
What shows on the page when you try = that?


It seems odd that on the = one hand you just want to see peoples' survey responses (what people = have submitted using your survey form), but on the other hand to find = those records your code is potentially checking ALL those various = fields.  Don't you just want to see all the records submitted on a = given day (or in a given date range)?  If so, then why make your = search check to see what is in the [name] field .. or in the [email] field, = etc.?  The code you just showed (if it had proper syntax) as if = means to only find records with a certain value in EVERY single field. = (!?)  ...well if you already know the exact value for every field, = then why even bother searching for that record?  I assume you = really meant to search for records where just ONE of the fields equals a = certain value (like where the date is yesterday, for example ("...&eqtheDatedatarq=3D[showResponsesOnThisDate]...")).

Keep at it.. and keep asking questions. =  It gets clear with practice.  Keep admitting blind spots in = your understanding of the code, where they are.. then = we can know to put more attention and shed more light = there.

- Govinda
= --Apple-Mail-5-234903704-- Govinda

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:

Spaces inside [AppendFile] (1998) WebCat2b12plugin - [search] is broken ... not! (1997) .. more on sliding discounts... (1997) New index for docs (1997) .. more on sliding discounts... (1997) HELP WITH DATES (1997) WCS Newbie question (1997) [append] and SSL (1997) WebCommerce: Folder organization ? (1997) WebCat2: multiple currency support (1997) WebCatalog NT beta 18 now available (1997) WebCatalog for guestbook ? (1997) [WebDNA] [OT] Free Windows FTP client recommendations (2009) HomePage Caution (1997) Location of Browser Info.txt file (1997) [OT] Form POSTing with LONG variable (2007) Re:no template caching (1997) Enhancement Request for WebCatalog-NT (1996) Exists? (1997) PCS Frames-Default page is solution! (1997)