subwayman wrote:Yes you could do this but this is a common solution for the less experienced. What happens when somone adds a car but either the count update fails or the count update works but the car insert does not. You will also need extra code to reduce the count if a car gets removed. Far better to use the solution I gave with my last post. This is the regular way to do it and it will ALWAYS return an accurate count.
You are right. Can you explain me your query how will it work, mean
when we do query like count(1) from cars, what will it count and bring back.
If it bring only one car name like 20 mazda then what about other types.
DO i need to run in that case query for each car type.
thanks for your help and advice
I am going to explain u further more will help u what I am trying to do.
I got two tables, one is all types of car like accord , mazda, nissan, AND in second table its sub categories like there are 7 types of accord car, 11 types of nissan.
SO I am thinking to show on my first page all cars model name and number of customers car existing in the database EXAMPLE Nissan(30), Accord (40) bla bla.
When customer click on one of car model(like on Nissan(30)) then it shows their sub categories with their description.
Do I need to run your query, u mentioned above or different.
thanks again for your help