I am using the following query to find the total times each lead has been sold.
<?php
$query = "SELECT * FROM Leads WHERE Date = '$Today' AND Source = 'MFE.com' ORDER BY CustomerID ASC LIMIT 0, 1000";
$result = mysql_query($query);
$num=mysql_num_rows($result);
while ($row = mysql_fetch_assoc($result)) {
$CustomerID = $row['CustomerID'];
$query1 = "SELECT COUNT(CustomerID) AS qtysold FROM Purchased_Leads WHERE CustomerID = '$CustomerID'";
$result1 = mysql_query($query1);
$row1 = mysql_fetch_assoc($result1)
}
?>
this returns the number of times sold for each lead in the query. From this info, i also need to get the total times sold for all the leads in the query. i'm probably nt explaining this the best.
I've checked all over and cannot find a resolution for this. any help will be GREATLY appreciated.
thanks.