Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Wierd Search.cgi bug

Quote Reply
Wierd Search.cgi bug
Hi There,

I'm getting intermittent error results on a search and the error doesn't make any sense. This is the error message:

Search (21856): Fatal: query: Can't execute: SELECT count(*) FROM Artisans WHERE ID in () and (( CategoryID = "1")) (You
have an error in your SQL syntax near ') and (( CategoryID = "1"))' at line 1) at admin/Links/DBSQL.pm line 1530


My queries are very similar:
This causes the error:
search.cgi?t=nmcn&d=1&db=Artisans&CategoryID=1&query=chavezo

This doesn't cause the error:
search.cgi?t=nmcn&d=1&db=Artisans&CategoryID=1&query=chavez

chavez is in the database. Chavezo isn't. I've also search for items I know are in the database but aren't in that particular category. Those also don't give the error.

If I remove the CategoryID from the query I get the results I'd expect.

It's my understanding that LinkSQL should allow for these types of searches.

Thanks, looking forward to any ideas on this one. This ability raises the power of searching exponentially and is extremely important to me.

If you need to see it go here:
http://www.nmculturenet.org/cgi-bin/webman/page.cgi?g=&t=nmcn&d=1&db=Artisans

Peace.

Kyle





[This message has been edited by klangan (edited February 10, 2000).]
Quote Reply
Re: Wierd Search.cgi bug In reply to
Hi Kyle,

Are you still having this problem? I know of a problem when using accents, but if it's a regular word, I haven't found anything I can reproduce. Can I get admin access to check out your SQL tables to see what's going on?

Cheers,

Alex
Quote Reply
Re: Wierd Search.cgi bug In reply to
Thanks Alex,

That indeed took care of it.

This is the fix:

in search.pm

AFTER:
# ... setup the filter if it was asked for
my $filterref = $self->{filter};
my $filter = undef;
my $where;

ADD
# ... nothing found
return undef if (!(@query_results));

Thanks for your attention.

Peace.

Kyle