Here is my query: [code]$clientsquery = "Select COUNT(DISTINCT(c.clientid)) from clients c, accountbalances ab, accounts a, clientaccounts ca where ab.quarteryear = 'form_qy' and ab.accountid = a.accountid and a.accountid = ca.accountid and ca.clientid = c.clientid"; $clientsresult = mysql_query($clientsquery); if(!$clientsresult){ $error_details = mysql_error(); errorhandler($error_details); } [/code] but i can not seem to pull the number out of the result i have tried: $db_clientnumber = mysql_result($clientsresult,0,"clientid"); and $db_clientnumber = mysql_result($clientsresult,0,"COUNT(DISTINCT(c.clientid))"); and $db_clientnumber = mysql_result($clientsresult,0,"COUNT(DISTINCT(clientid))"); but i keep getting: Warning: mysql_result() [function.mysql-result]: COUNT(DISTINCT(clientid)) not found in MySQL result index 16 in C:\WEB_ROOT\clientpro\fta_summary.php on line 33 (of course the error, looks a little different for each one i tried, but i did not copy them all over, same error though) Any ideas?