[ic] Query problem

Jamie Neil interchange-users@icdevgroup.org
Wed May 21 18:58:01 2003


> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Paul Jordan
> Sent: 21 May 2003 21:08
> To: interchange-users@icdevgroup.org
> Subject: RE: [ic] Query problem
>
>
> > The query only seems to return a match on the first record in the
> > table, so
> > if the email address matches on another record, no matches are returned.
> >
> > ---------------
> > Checking posted values...
> > [tmp failed_tests][/tmp]
> > [query type=list sql="select email from userdb where email =
> > '[cgi email]'"]
> > [list][sql-code][/list]
> > [on-match]
> >         Failed<br><br>
> >         Error: Duplicate email address found in database<br><br>
> >         [tmp failed_tests]1[/tmp]
> > [/on-match]
> > [no-match]
> >         ok<br><br>
> >         [value name=email set="[cgi email]" hide=1]
> > [/no-match]
> > [/query]
> > ---------------
> >
>
> try:
>
> [query
> 	type=list
> 	table="userdb"
      ^^^^^^^^^^^^^^
Thanks, this was the magic value!

But why the need to specify the table? The select already specifies userdb.

I have also successfully tried queries on several other tables without
having to specify the table. Is userdb special or is this a bug?

> 	sp="@@MV_PAGE@@"
> 	ml=9999
> 	sql=|
> 		SELECT email
> 		FROM   userdb
> 		WHERE  email = '[cgi email]'
> 	|]
>
> and also, filter that cgi value.

I had already prefiltered the cgi variables (filter="30 lc no_white")

I guess I should really write a proper email filter, but the form is being
posted from a trusted source (IP address filtering and username/password) so
I'm not going to get too paranoid :)

Thanks again,

Jamie

>
> Paul
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>