Loop DB for multiple values
- December 16, 2009
- 1 reply
- 273 views
I wanted to get an opinion on the best way to go about doing this. Here's what I need to accomplish:
I want to query my db for a range of values. (find motors between 5 and 50 HP) Then, from that query, I want to be able to count items that have the same HP so that my page can say we have x number of 5 hp motors available, x number of 50 HP motors available. The curve ball is that while there is a standard for the motors, there is always a few odd motors so I can't create static queries of certain HPs. Does that make sense?
I've attached the layout of the output if it helps. (The values are only there to fill out the look and aren't accurate) I also don't need the code, I just want to know the best process. I have an idea of how to do it but I want to make sure it's the best way. Thanks for the help!