These are my tables and fields.
student_info(table) contains ( id(PK), student_name)
student_subject(table) contains ( id(PK), student_id(FK), subject_name)
below is my query:
$getRecords= mysql_query("select student_info.id, student_name, student_subject FROM student_info,student_subject WHERE student_info.id = student_subject.student_id");
while($getresult=mysql_fetch_assoc($getRecords))
{
$arr[] = array('id' => $getresult['id'], 'subjects' => $getresult['subject_name'], 'name' => $getresult['student_name']),
}
In student_subject table I have at least 5 subjects(different rows) pointing to the same student. But the variable subjects in the array can only get 1 value how I can get those other subjects . I need simple solution/query coz I just started learning about this. Thank you for your help