I want to list the total number of items in several tables. I was hoping to
do it in one query, because potentially there could be 10 or more totals and
running that many queries on one page seems silly. Here's the code I tried:
<cfquery name="count" datasource="#request.dsn#">
select count(artists.artist_id) as artists,
count(artworks.artwork_id) as artworks,
count(news.article_id) as news
from artists, artworks, news
</cfquery>
<cfoutput>
#count.artists# artists listed
#count.artworks# artworks listed
#count.news# news articles
</cfoutput>
But this gives me the total value of all the tables combined for each
variable. What am I doing wrong?
Thanks,
K.
______________________________________________________
Kay Smoljak - HTML/ColdFusion Developer - PerthWeb Pty Ltd
Internet Solutions for your business!
Level 9/105 St George's Tc - Perth - Western Australia
Ph: (08) 9226 1366 Fax: (08) 9226 1375 Mobile : 0419 949 007
Visit Perth online! : www.perthweb.com.au
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]