Re: Multiple SQL queries...?
| From: | Daniel Clark | Date: | Thu, 03 Jun 2004 15:49:58 +0000 |
| Subject: | Re: Multiple SQL queries...? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34639@lists.php.net to get a copy of this message | ||
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...