Gossamer Forum
Home : Products : DBMan : Installation :

calling &query()

Quote Reply
calling &query()
ok, maybe its easy, but i cant find out.

i want to have a sub-routine,
that prduces a html page with the number
of search hits of a specific keyword.

==> i have a database field called "System".
A user can have the entry "Win95", "WinNT"
and "Win3.11".

i now want to query the database and want to
get variables in return, telling me,
how often the specific user has
Win95, WinNT and Win3.11 in the Field "System1" in all his entries.

Can anyone give me a clue of how to do
that ? i couldnt find out,
what parameters to give to
either &view_records; or &query;

Thanks in advance,
Florian


[This message has been edited by Florian (edited December 05, 1998).]
Quote Reply
Re: calling &query() In reply to
Hi Florian,

Set the parameters up in %in, then call &query. You'll find the total hits in the globals $db_total_hits.

So to find all hits with 'boo' in the field 'Title':

sub boohits {
# ----------------------
$in{'Title'} = 'boo';
my ($status, @results) = &query('view');
print "Found $db_next_hits hits!";
}

Hope that helps,

Alex