title: PHP Display Multiple Value From One Row
body: <p>For example I have MySQL two tables, Category and Student.</p>
  
  <pre><code>---------------------
  | id_cat | name_cat  |
  ----------------------
  |  1     | language  |
  |  2     | math      |
  |  3     | science   |
  ---------------------  
  
  ---------------------------------------
  | id_student | name_student | id_cat  |
  ---------------------------------------
  |      1     | Peter Parker | 2, 3    |
  |      2     | Tony Stark   | 1, 2, 3 |
  |      3     | Bruce Wayne  | 3       |
  ---------------------------------------
  </code></pre>
  
  <p>Then I tried with this code line :</p>
  
  <pre><code>$check=mysqli_query($conn, "SELECT * FROM student LEFT OUTER JOIN category ON student .id_cat = category.id_cat ORDER BY id_student ASC");
  while($data=mysqli_fetch_array($check)){ 
      $namestudent = $data['name_student'];
      $namecat = $data['name_cat'];
      echo ''.$namestudent.' : '.$namecat.'';
  }
  </code></pre>
  
  <p>But the result is<br>
  Peter Parker : math<br>
  Tony Stark : language<br>
  Bruce Wayne : science</p>
  
  <p>According to table, the right output is <br>
  Peter Parker : math, science<br>
  Tony Stark : language, math, science<br>
  Bruce Wayne : science</p>