Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [brewt] Suggest category

Quote Reply
Re: [brewt] Suggest category In reply to
Sorry for wait... just tested it out...

You want what Adrian said, but you also want it within the while statement.

Code:

my $t = $DB->table('Category');
$t->select_options('ORDER by Name DESC', 'LIMIT 25');
my $q = $IN->param('query');
my $cond = GT::SQL::Condition->new( 'Full_Name', 'LIKE', "$q%");
my $sth = $t->select($cond);

my $base = 'http://www.magicdirectory.com/linksSQL/';
print "Content-Type: text/xml\n\n";
if ($t->hits) {
print qq|<ul class="LSRes">|;
while (my $result = $sth->fetchrow_hashref) {
my $path = $t->as_url($result->{Full_Name});
print qq|<li onmouseover="liveSearchHover(this)" onclick="liveSearchClicked(this)"><a href="$base$path" name="$result->{Full_Name}">$result->{Full_Name}</a> </li>\n|;
}
print qq|</ul>|;
}


http://www.magicdirectory.com/...sSQL/livesearch.html

Note... all my category start with m....

- Jonathan
Subject Author Views Date
Thread Suggest category gotze 2615 Jan 8, 2005, 12:39 PM
Thread Re: [gotze] Suggest category
jdgamble 2573 Jan 8, 2005, 2:39 PM
Post Re: [jdgamble] Suggest category
gotze 2572 Jan 8, 2005, 3:06 PM
Thread Re: [gotze] Suggest category
brewt 2571 Jan 8, 2005, 4:37 PM
Thread Re: [brewt] Suggest category
gotze 2567 Jan 8, 2005, 4:55 PM
Post Re: [gotze] Suggest category
Jag 2543 Jan 9, 2005, 9:27 AM
Post Re: [brewt] Suggest category
jdgamble 2564 Jan 8, 2005, 4:56 PM