[ic] Query problem

Jamie Neil interchange-users@icdevgroup.org
Wed May 21 15:53:00 2003


> -----Original Message-----
> From: interchange-users-admin@icdevgroup.org
> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Jamie Neil
> Sent: 21 May 2003 20:20
> To: interchange-users@icdevgroup.org
> Subject: [ic] Query problem
>
>
> Can anyone explain why this code snipit doesn't work?
>
> 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.

I've just run some more tests on this and found some weird results.

If I put the query:

	select username from userdb where email = 'user1@domain'

into the admin query builder, it comes back with a match. And if I then use:

	[query type=row_count sql="select username from userdb where email =
'user1@domain'"]

I get 1 match which is correct.

But if put in:

	select username from userdb where email = 'user2@domain'

the address is found ok, but then:

	[query type=row_count sql="select username from userdb where email =
'user2@domain'"]

finds 0 matches!

This is driving me spare.

Jamie

>
> ---------------
> 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]
> ---------------
>
> Another thing I noted is that if the [list][/list] is missing then
> [no-match] is always skipped, and if type=list is missing, the query just
> doesn't work!
>
> I'm sure it's an obvious one, but I just can't see it. Can anyone shed any
> light?...
>
> Jamie Neil
> Versado I.T. Services Ltd.
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>