Nope... HHmmm, this is really getting to me... I can do distinct, I can count, but I can't combine the two? Can't be that hard ;-) "Daniel Clark" <dclark@xxxxxxxxxx> 03/06/2004 16:49 Please respond to dclark@xxxxxxxxxx To Tristan.Pretty@xxxxxxxxxxxxxxxx cc "Daniel Clark" <dclark@xxxxxxxxxx>, "php-db@xxxxxxxxxxxxx" <php-db@xxxxxxxxxxxxx> Subject Re: Multiple SQL queries...? OK, how about this? $sql = "SELECT DISTINCT(email) FROM $table"; $result = mysql_query($sql,$connection) or die("Couldn't execute query 0."); while ($row = mysql_fetch_array($result)) { echo $row[email] ; $sql1 = "SELECT * FROM $table WHERE viewed = '1' AND email = '$row[email]'"; $result1 = mysql_query($sql1,$connection) or die("Couldn't execute query 1."); echo ' ' . mysql_num_rows($result1) ; } echo $row1 ; > Kinda, but I just wanna count how many views in total... > Hence my $row1++; bit... > I'll have a play with your code though...! > Cheers, > Tris... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php