-
Display records with sub-records
What would be the best way to print out records with sub-records attached to them? Suppose I have 2 tables, something like this:
User table:
| User_id |
User_name |
| 1 |
John |
| 2 |
Mick |
Movie table:
| User_id |
Movie_name |
Rating |
| 1 |
Die Hard |
5 |
| 1 |
MIB |
8 |
| 2 |
Iron Man |
6 |
What I want to get, is this:
John:
Mick:
Should I do an inner join and process the query result using, for example, PHP or is there a better way to organize the result with the help of mysql?
-
You would do the formatting in PHP as you suggest.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks