tgelston
-
Posts
3 -
Joined
-
Last visited
Never
Posts posted by tgelston
-
-
Thank you for your reply - Looking at your code I see userInfo.project_id - I don't have a project_id field in my userInfo tbl? IS this a typo or am I not understanding your join syntax. I tried your code both as you have written it and as my example below
[!--quoteo(post=360404:date=Mar 31 2006, 11:34 AM:name=jvrothjr)--][div class=\'quotetop\']QUOTE(jvrothjr @ Mar 31 2006, 11:34 AM) [snapback]360404[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]
$query = ("select * from userInfo
left join studentGrade on userInfo.project_id=studentGrade.project_id
where studentGrade.project_id = 45");
[/code]
[/quote]
[code]$query = 'SELECT * from assignmentInfo, userInfo LEFT JOIN studentGrade on assignmentInfo.project_id=studentGrade.project_id WHERE studentGrade.project_id = 45';
[/code]
But I still get the output three times. . all students are listed.. . I need to go read up on joins?
I appreciate the help!
-
I am stumped - I started an ambitious project of creating my own online gradebook and I love the challenge of learning as I go. . but now I am stuck! Here is what I want to do
I need to click on a project title and be presented with a list of all my students and the grades they received for that project. I have two tables, studentGrade that holds project id, student id and grade AND userInfo that holds the student id, names and other info of all my students. This is a join. . . I have done other, simple joins before. . I just can't seem to wrap my brain around what I need to do here. I want all students listed - even if they do not have a grade.
example output would look something like
john smith 89
mary jane
Tom Kat 54
I have this
[code]$query='SELECT * FROM userInfo, studentGrade, assignmentInfo WHERE studentGrade.project_id = 45 AND assignmentInfo.project_id = 45';[/code]
But it outputs all students 3x with the grade filled in for every student
Hints, suggestion and tips would all be very much appreciated.
Thank You,
Tobias
Query from multiple tables probably simple
in MySQL Help
Posted