title: Implementing link in PHP foreach loop
body: <p>Trying to implement links in my foreach loop. However, can't get the $category link working. Any pointers? Managed to get the link to work for the sub-category, as shown below:</p>
  
  <pre><code>&lt;?
  $output = mysqli_query("SELECT * FROM bikes, bikeTypes WHERE bikes.model_id = bikeTypes.model_id");
  $result = array();
  while($row = mysqli_fetch_array($output))
  {
     $result[$row['model']][] = $row;
  }
  
  foreach ($result as $category =&gt; $values) {
    echo "&lt;li&gt;".$category.'&lt;ul&gt;';
      foreach ($values as $value) {
        echo "&lt;a href='details.php?id=" . $row['model_id'] . "'&gt;&lt;li&gt;" . $value['bikeName'] . "&lt;/a&gt;&lt;/li&gt;";
      }
  echo '&lt;/ul&gt;';   
  echo '&lt;/li&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>Thanks for the help in advance guys! :)</p>