title: Left join with multiple rows
body: <p>I have these two tables:</p>
  
  <pre><code>sections - {id,title,description}
  topics - {id,section_id,topictitle}
  </code></pre>
  
  <p>Each section has multiple topics in the topics table.</p>
  
  <p>after reading and trying I found using left join is the right way</p>
  
  <pre><code>$sql = 'select * from sections left join topics on sections.id=topics.sections_id';
  $query = mysql_query($sql);
  $section = array();
  $i=0;
  while ($sections = mysql_fetch_assoc($query)) {
      $sl = array(
          'title' =&gt; $sections['title'],
          'topics'=&gt; $sections['topictitle'],
      );
      $section[$i++] = $sl;
  }
  </code></pre>
  
  <p>Is this the right code to view all sections and topics??</p>