CodeIgniter Forums
Getting news from only the courses I am enrolled on - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Getting news from only the courses I am enrolled on (/thread-30041.html)



Getting news from only the courses I am enrolled on - El Forum - 04-30-2010

[eluser]JamieBarton[/eluser]
Hi guys,

I have probably done this before, but, it's Friday afternoon and I feel really worn out and tired, and I'm sure we all do, but there must be somebody here that is a little less tired and brainless than me today, right now..

I want to show news articles in a list of courses I am enrolled on.

My database is set-up as follows:

Courses [TABLE]:
id
name
level
length
description
leader

==========

Students [TABLE]:
id
first_name
last_name
etc...

==========

CoursesStudents [TABLE]:
student_id
course_id

==========

CourseNews [TABLE]:
id
title
body
course_id

==========

So it's just the SQL I need help with, something that I'm not a huge fan of, or knowledgeable on, I am picking up tricks and learning a lot from these forums with the help I've been getting lately.

But I just need to show news articles, from courses than I am enrolled on. Also, I'd like to be able to display the course 'name' beside each news title, so, a JOIN would be needed there..

Any help would be greatly appreciated.


Smile