Sorry for wait... just tested it out...
You want what Adrian said, but you also want it within the while statement.
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
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