You could explode your comma separated string into an array, and then build a query that would pull the records for all those IDs, and then loop through that recordset on your page.
Right after your original recordset, you could have something like this.
This is assuming that your comma separated string is $row_Recordset1['related_course_ids']
$related_courses_query="WHERE 1=2";
if (isset($row_Recordset1['related_course_ids']) && $row_Recordset1['related_course_ids'] !=''){
$favorites_query="WHERE ";
$favorites_list_array=explode(",",$row_Recordset1['related_course_ids']);
foreach($id_list_array as $id){
if($id!='' && is_numeric($id)){
$id_query.="course_id=$id OR ";
$list=true;
}
}
if($list){
$id_query=substr($id_query,0,-3);
}else{
$id_query="WHERE 1=2";
}
}
//then for your courses query
mysql_select_db($database_dbc, $dbc);
$query_rsCourses = "SELECT * FROM courses $id_query";
$getPhotos = mysql_query($query_rsCourses, $dbc) or die(mysql_error());
$row_rsCourses = mysql_fetch_assoc($rsCourses);
Then you can loop though the rsCourses recordset, and provide a link to each related course.
Is that what you were looking for?
Tom