Hi,
hehe NP =)
Sounds like you would indeed be better with fetchrow_hashref. Something like:
my $cond = GT::SQL::Condition->new( 'isValidated' => '=' => 'Yes', 'something' => '=' => '5' );
$links_db->select_options ("GROUP BY Links.ID ORDER BY Mod_Date DESC", "LIMIT 30");
my $sth2 = $links_db->select( ['Links.ID','Title','URL'] => $cond ) || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
# you now have access to $hit->{ID}, $hit->{Title} and $hit->{URL}
do_stuff($hit);
# $hit will now have the values, including what was editing in do_stuff()
}
sub do_stuff {
# access $hit via $_[0]->{Field}, as this means you dont need to return anything (makes it quicker than doing a copy + return)
}
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:
I dont speak no single word of perl, i am just like a child playing with Lego. :)hehe NP =)
Sounds like you would indeed be better with fetchrow_hashref. Something like:
Code:
my $links_db = $DB->table ('Links', 'CatLinks', 'Category'); my $cond = GT::SQL::Condition->new( 'isValidated' => '=' => 'Yes', 'something' => '=' => '5' );
$links_db->select_options ("GROUP BY Links.ID ORDER BY Mod_Date DESC", "LIMIT 30");
my $sth2 = $links_db->select( ['Links.ID','Title','URL'] => $cond ) || die $GT::SQL::error;
while (my $hit = $sth->fetchrow_hashref) {
# you now have access to $hit->{ID}, $hit->{Title} and $hit->{URL}
do_stuff($hit);
# $hit will now have the values, including what was editing in do_stuff()
}
sub do_stuff {
# access $hit via $_[0]->{Field}, as this means you dont need to return anything (makes it quicker than doing a copy + return)
}
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!