dprichard
08-03-2008, 12:57 AM
Okay, I have been putting off trying to figure out how to do this and I am at a crossroad where I just gotta figure it out.
I have the following
Table 1
NewsCategoryId
Category Name
Table 2
NewsStoryId
NewsCategoryId
I want to be able to show it on my PHP page page like this:
News Category1
- Story 1
- Story 2
- Story 3
News Category2
- Story 1
- Story 2
- Story 3
I have been searching google, but am not sure what I am trying to do is called so I am not getting good results. Any help or direction would be greatly appreciated.
I know I can do the following, but I can't imagine doing a query for each result from table 1 is good practice and will probably be a load on the server:
Query 1
While $row = mysql fetch array
Query 2
But I am sure there is a better way.
I have the following
Table 1
NewsCategoryId
Category Name
Table 2
NewsStoryId
NewsCategoryId
I want to be able to show it on my PHP page page like this:
News Category1
- Story 1
- Story 2
- Story 3
News Category2
- Story 1
- Story 2
- Story 3
I have been searching google, but am not sure what I am trying to do is called so I am not getting good results. Any help or direction would be greatly appreciated.
I know I can do the following, but I can't imagine doing a query for each result from table 1 is good practice and will probably be a load on the server:
Query 1
While $row = mysql fetch array
Query 2
But I am sure there is a better way.