Presto-X Posted January 22, 2010 Share Posted January 22, 2010 Hello everyone, I am wanting to display is list of course titles that a student has signed up for, so I am first querying the student list table and getting a list of all of the courses (by CourseID) the student signed up for by StudentID, then looking up the course title from the courses table by CourseID. The Problem that I am having is if the student has signed up for the same course more than once, I don’t want to display the same title several times. Is there a way in php or mysql to check if a id has been looped out once before if so skip it? Link to comment https://forums.phpfreaks.com/topic/189416-a-non-repeating-loop/ Share on other sites More sharing options...
The Little Guy Posted January 22, 2010 Share Posted January 22, 2010 Like so: SELECT DISTINCT(StudentID), CourseID FROM table_name GROUP BY CourseID Link to comment https://forums.phpfreaks.com/topic/189416-a-non-repeating-loop/#findComment-999797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.