Jump to content

padawan

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Posts posted by padawan

  1. 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  :confused:.  I need simple solution/query coz I just started learning about this.  Thank you for your help

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.