mysql - retrieve and display php array values when retrieving all records from database -


i displaying complete record of user in profile section, fetching rows , problem within rows i've got 2 fields arrays, 'secondarysubject' , 'secondarygrade' want display

2002-2004 ----------- level ------- school name

                  science                            maths            b 

i able display them prints dates, school name , level name every subject rather once subjects. posting code, can pleaseeee me it.

$result2 = $db->query('  select *  secondaryeducation  userid = "'.$graduateid.'"  order secondaryfinishdate desc  ');    $totalrows2 = mysql_num_rows($result2);  if($totalrows2 > 0)  {      $html .= '<h2>secondary education: '.$option.'</h2>';       while($row = mysql_fetch_assoc($result2))      {            $startyear = formatdate($row['secondarystartdate'], 'y');          $finishyear = formatdate($row['secondaryfinishdate'], 'y');          if (!empty($row['secondarygrade']))              $secondarygrade = getsecondarygradename($row['secondarygrade']);          else              $secondarygrade = $row['secondarygradecustom'];          $html .= '                <div class="secondarylisting">                  <div><strong>'.$startyear.' - '.$finishyear.' '.stripslashes($row['secondaryschool']).'</strong></div>                  <div>'.stripslashes(getsecondarylevelname($row['secondarylevel'])).' in '.stripslashes(getsecondarysubjectname($row['secondarysubject'])).' - '.stripslashes($secondarygrade).'</div>              </div><!-- end education listing -->            ';        }    } 

it looks inside while statement. every time loops include it. try moving outside while statement.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -