Ovid wrote:
For a personal project, I want users to be able to click on a letter and get a
list of countries starting with that letter. I can do this:
Considering that there are only about 250 countries in total, you should just
list them all on one screen and be done with it.
I think that would be a lot more user friendly than requiring them to click a
letter first, especially if they're not sure exactly how their country is
spelled or what letter it might be under (eg, is "Republic of Ireland" under "I"
or "R").
Save clicking a letter when you're doing a list of cities or something.
my $letters = $c->model('DB')->storage->dbh->selectcol_arrayref(
'select distinct(substr(name,1,1)) as letter from country order by
letter'
);
$c->stash->{letters} = $letters;
Also, to use 'distinct' I don't think you ever use parens; you just say "select
distinct <foo-expr> as bar from baz ...".
-- Darren Duncan
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/