I have two tables that I need to get the following information but I can't seem to figure out how to structure the query:

Table 1

type
show
max
min

Table 2
model
height
width
depth

In Table 1 I have the following for the first row (as an example):

height
18" - 21.9"
21.9
18

and

Model
19.9
25.9
30.1

Basically in Table I want to link the two tables and have it count out the number of results for each parameter. For example, on the navbar I want it to grab each row and show the following by counting the number of models and then showing it next to each row. Then I want to use the result Further down in table 1 are rows with width parameters, depth parameters, etc.

Height:
18" - 21.9" (number of models)

Does that make sense?

I've tried:

mysql_query("SELECT 
    count(Dimensions.model) AS total, dimensions_table.show, dimensions_table.max as maxd, dimensions_table.min as mind, dimension_table.type as ptype
FROM 
    Dimensions, dimensions_table
    WHERE Dimensions.ptype BETWEEN dimensions_table.maxd AND dimensions_table.mind");

But so far it's not returning any results?

Test your problem in the access query design and do your inputs there to see what's going wrong. Do forget to do some inputs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.