Quote:
Erm, not really ;) You still have to do a foreach() to get those values out
I agree there's not great deal of difference, but fetchall_list is ideal for this sort of situation where you only need a list of values from one colunm and it also saves you having to deal with the $sth object.
I was thinking along the lines of:
Code:
my @users = $DB->table('Links')->select('DISTINCT(LinkOwner)')->fetchall_list;
return qq|<select name="LinkOwner">\n| . map(qq|<option value=$_">$_</option>\n|, @users) . qq|</select>\n|;
The newlines are useful for display purposes too.
Quote:
Why? GT::SQL does this all for you. Thats why its a lot cleaner that trying to use DBI
In a small code snippet it is perhaps not a big deal but calling $sth->finish() is good coding practice. GT::SQL only calls finish() when the $sth object is about to be destroyed. If you have a piece of code performing lots of queries then you are going to have lots of open handles which is not a good idea.