- 0
PHP - SQL Efficiency Questions
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Distributed SQL: The architecture behind MariaDB Xpand — Free Whitepaper
By News Staff,
- ebook offer
- sponsored
- (and 4 more)
- 0 replies
- 4 views
-
- 0 replies
- 5 views
-
- 8 replies
- 1,914 views
-
Save 98% off this multi-course Premium Coding Skills Bundle
By News Staff,
- neowin deals
- online courses
- (and 12 more)
- 0 replies
- 4 views
-
This Premium Google Sheets & Microsoft Excel Certification Bundle is Price Dropped to $20
By News Staff,
- google sheets
- microsoft excel
- (and 9 more)
- 0 replies
- 1 view
-
Question
xWhiplash
Hello,
After many years, I have finally decided to build a database for my website.
I have a Video table that has ID, Name, Description, Series_ID, Size, and more.
I have a Resource table that contains the name and location (for links for resources).
I have a Video_Resource table that has the Video ID and the Resource ID.
I am new to PHP and MySQL. I have used SQL Server and ASP.NET before, so I will use that for my examples.
What I need to do is have a page listing all the videos by a specific series ID, which is a simple query, and resources for each video. Now with ASP.NET I would do something like this:
I know I could combine those into one query:
But what I do NOT want to have happen is multiple records since some videos might have 5 or more resources. I do not want video ID 3 to be displayed 5 times since the query outputted it 5 times.
Basically this is what I want my output to be:
Now my questions:
Thanks!
Link to comment
Share on other sites
18 answers to this question
Recommended Posts