title: mysqli_fetch_array using a foreach loop
body: <p>Ive got a pretty basic table named 'customers' with four columns:<br>
  ID (primary Auto Increment)<br>
  businessName<br>
  contactName<br>
  contactEmail  </p>
  
  <p>I call it with:     </p>
  
  <pre><code>$result = mysqli_query($con, "SELECT * FROM customers");
  </code></pre>
  
  <p>and was using mysqli_fetch_array to display it on the page with a foreach loop:</p>
  
  <pre><code>while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
  {    
      echo "&lt;tr&gt;";
      foreach ($row as $value) {
          echo "&lt;td&gt;" . $value . "&lt;/td&gt;";
      }
      echo "&lt;td&gt;&lt;a href='updateform.php?id=" . $row['id'] . "'&gt;Edit&lt;/a&gt;&lt;/td&gt;";
      echo "&lt;/tr&gt;";
  }
  </code></pre>
  
  <p>Which gives you an array like:  </p>
  
  <pre><code>Array ( [id] =&gt; 1 [businessName] =&gt; Microsoft [contactName] =&gt; Bill Gates [contactEmail] =&gt; bill@microsoft.com ) Array ( [id] =&gt; 2 [businessName] =&gt; Amazon [contactName] =&gt; Jeff Bezos [contactEmail] =&gt; jeff@amazon.com ) 
  </code></pre>
  
  <p>Is it possible to display results differently based on which column (technically now position in the array) they are in? I would like to make a  </p>
  
  <pre><code>a href="mailto:bill@microsoft.com"  
  </code></pre>
  
  <p>link when it gets to contactEmail.<br>
  What if I wanted to display just one key or value instead of using foreach?<br>
  It doesn't seem possible to call </p>
  
  <pre><code>$row['contactEmail'] 
  </code></pre>
  
  <p>in the foreach loop
  which confuses me since below that I am able to create a link to  </p>
  
  <pre><code>$row['id']
  </code></pre>
  
  <p>If anyone has any ideas how to do this, or if there is a better way to be displaying this information, I'm open to suggestions, as I'm not very good at programming, especially PHP.</p>