dagger2002
Programmer
Here is my problem. I have written a php script that reads from a database, mysql. Then it counts all of the records and prints them to the screen and to a flat file. I have it working but it prints the same file the number of times it is in the db.
if i have 5 records for jim it prints this:
jim 5
jim 5
jim 5
jim 5
jim 5
when all i want is this
jim 5
here is my query set:
any ideas?
if i have 5 records for jim it prints this:
jim 5
jim 5
jim 5
jim 5
jim 5
when all i want is this
jim 5
here is my query set:
Code:
// Selects a Page
$queryBody = "SELECT * FROM `temp_stats`_uniq WHERE `stat_page` NOT LIKE '/BoE/index_BoE.php?' ORDER BY stat_page ASC";
$resBody = mysql_query($queryBody) or die/*(mysql_error());//*/("Error with the Body.");
$rowBody = mysql_fetch_array($resBody);
$numBody = mysql_num_rows($resBody);
// Count Individual Pages
$queryBody2 = "SELECT * FROM `temp_stats`_uniq WHERE `stat_page` LIKE '$rowBody[stat_page]' ORDER BY stat_title DESC";
$resBody2 = mysql_query($queryBody2) or die(mysql_error());//*/("Error with the Body2.");
$rowBody2 = mysql_fetch_array($resBody2);
$numBody2 = mysql_num_rows($resBody2);
while($rowBody = mysql_fetch_array($resBody)){
// Count Individual Pages
$queryBody2 = "SELECT * FROM `temp_stats` WHERE `stat_page` LIKE '$rowBody[stat_page]' ORDER BY stat_title DESC";
$resBody2 = mysql_query($queryBody2) or die(mysql_error());//*/("Error with the Body2.");
$rowBody2 = mysql_fetch_array($resBody2);
$numBody2 = mysql_num_rows($resBody2);
any ideas?