Re: [Zope] Probably Dumb Question re count(*)
31 Dec
2001
31 Dec
'01
1:01 a.m.
Matt Goodall suggested:
Change the "countrecords" SQL method to
select count(*) as num_records from xyz
so that you know the name (num_records) of the column. Then use the following to display that count:
<dtml-var "countrecords()[0]['num_records']">
The DTML is simply getting the column named num_records from the 1st row of the result set.
Thanks, Matt. Worked like a charm. The MySQL book I have mentioned the AS option but didn't include it in the reference section I was looking in, so I didn't remember how to do this column aliasing thing! -- Dan Shafer, Author-Consultant http://www.danshafer.com http://www.shafermedia.com
8861
Age (days ago)
8861
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dan Shafer