Jump to content

Multidimensional array


ram4nd

Recommended Posts

Umm, what do you mean by table setup?

I think the point of the question is to determine whether a subcategory is associated with a specific category, because you may be able to execute a single SQL query to retrieve data from both tables in one go

Umm, what do you mean by table setup?

I think the point of the question is to determine whether a subcategory is associated with a specific category, because you may be able to execute a single SQL query to retrieve data from both tables in one go

 

Yeah thats what i was getting at...

Umm, ok it is not associated.

category - id name

subcategory- id name category_id

suggests that it is associated, on category_id.

 

Alternatively, you could use a UNION in your query:

SELECT ID,
       NAME
  FROM CATEGORY
UNION
SELECT ID,
       NAME
  FROM SUBCATEGORY

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.