<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>I am trying to print the number of downloads a 
user's attachments have produced and am 95% there. I just don't know how to 
print zero if the SUM returns nothing.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>here's what I have so far (with download count 
module installed which creates file_downloads table)</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&lt;?php<BR>$query= "SELECT SUM(count) AS 
DownloadCount<BR>FROM upload<BR>JOIN files <BR>ON upload.fid = files.fid<BR>JOIN 
file_downloads<BR>ON files.filepath = CONCAT( 'sites/default/files/', 
file_downloads.filename )<BR>WHERE (files.uid = $account-&gt;uid)";<BR>$results 
= db_query($query);<BR>while($output = db_fetch_object($results)){<BR>print 
$output-&gt;DownloadCount;<BR>}<BR>?&gt;</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>works perfectly for those whose content have 
created downloads. For those who haven't, the result is a blank space. How can I 
print a nice fat "0"??</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>regards<BR><BR>Neil</FONT></DIV></BODY></HTML>