Welcome Guest, Not a member yet? Register   Sign In
Looping through a DB for all information
#1

[eluser]codemonkey[/eluser]
Hello, I need some help understanding how I would query a database table (using AR) and provide row counts for each different type of certain data.

Example:

A table named Toys has a column for id, name, type, and condition.

Types range from dolls, cars, and army men

How can I loop through (maybe loop through is the wrong word) and display how many rows contain each toy type excluding a condition of old.

I was thinking I would need to do multiple queries but I'm hoping I can reduce the amount with just one query and sort through the data.

Thanks


Messages In This Thread
Looping through a DB for all information - by El Forum - 04-30-2012, 10:34 AM
Looping through a DB for all information - by El Forum - 04-30-2012, 11:00 AM
Looping through a DB for all information - by El Forum - 04-30-2012, 12:03 PM
Looping through a DB for all information - by El Forum - 04-30-2012, 12:23 PM
Looping through a DB for all information - by El Forum - 04-30-2012, 07:58 PM
Looping through a DB for all information - by El Forum - 04-30-2012, 08:06 PM
Looping through a DB for all information - by El Forum - 04-30-2012, 08:32 PM
Looping through a DB for all information - by El Forum - 04-30-2012, 11:17 PM
Looping through a DB for all information - by El Forum - 05-01-2012, 08:16 AM
Looping through a DB for all information - by El Forum - 05-01-2012, 09:34 AM
Looping through a DB for all information - by El Forum - 05-01-2012, 09:42 AM
Looping through a DB for all information - by El Forum - 05-01-2012, 10:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB