Gossamer Forum
Home : Products : Gossamer Links : Discussions :

ordering link retrieved using global

Quote Reply
ordering link retrieved using global
I'm using the following code to retrieve certain links to be used in a page built by pagebuilder.

I would like to order the links alphabetically and by date added. What would I need to add to the global to do that?

Thanks

CCUnet

Code:
sub {
my $table = $DB->table('Links');
my $sth = $table->select( { isPriority => '1' } ) or return "Error: $GT::SQL::error";
my ($link,$hit,$output);
while (my $hit = $sth->fetchrow_hashref) { $link = $table->select ('*', { ID => $hit->{ID} })->fetchrow_hashref;
$output .= Links::SiteHTML::display ('link', $link);
}
return $output; }
my Christian web
Quote Reply
Re: [ccunet] ordering link retrieved using global In reply to
Before the 'my $sth' bit, add something like;

$table->select_options('ORDER BY Title,Date');

Something like that should work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] ordering link retrieved using global In reply to
Thanks Andy,

Its actually Title,Add_Date but other wise it works fine.

CCUnet
my Christian web