Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I was wondering how I can do a GROUP total count? When i do a row count, they are seperated like below output. The answer is 17-but I'm not sure how to do a Complete count. I want to COUNT the total items that are displayed.

Anyone have any ideas?

What I have tried:

$cnt=0;

while($dbRow=$dbQuery->fetch(PDO::FETCH_ASSOC))  
    {
            echo "".$dbRow["Name"].""."<img src=/".$dbRow['Pic']."' width='150' height='150' />"."".$dbRow["ID"]."<input type='submit' name='submit' value='Complete' >";
	  $cnt++;
 }
	}
	var_dump($cnt);


OUTPUT:
3 3 3 int(3) 3 3 3 int(3) 3 3 3 int(3) 1 int(1) 1 int(1) 2 2 int(2) int(0) 3 3 3 int(3) 1 int(1)
Posted
Updated 30-Mar-18 11:08am
v4
Comments
Wendelius 30-Mar-18 16:51pm    
Could you explain in more detail. What is the source data and what kind of result you're trying to get? Also showing the current SQL statement would help to understand the situation.
Member 13637584 30-Mar-18 17:07pm    
see edited question.
Patrice T 30-Mar-18 17:21pm    
show the code that generate this output with SQL query.
Member 13637584 30-Mar-18 17:23pm    
var_dump($cnt) above is the code to outputs this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900