title: Print query with loops in it and condition
body: <p>I have a foreach function which permits me to print fields in a database,</p>
  
  <p>I want to do possible that if <code>$row[value]="photo"</code> don't just print the <code>$row[value]</code> but another thing.</p>
  
  <p>Can I do it?</p>
  
  <p>The code is this: </p>
  
  <pre><code>while($row = mysql_fetch_array($result)) {
      echo "&lt;tr&gt;";
      foreach($checked1 as $key =&gt; $value){
          echo "&lt;td&gt;" . $row[$value] . "&lt;/td&gt;"; 
      }
  </code></pre>
  
  <p>I need to have a condition that <code>if $row[value]=photo</code> to echo another thing not: <code>echo "&lt;td&gt;" . $row[$photo] . "&lt;/td&gt;"</code>;</p>
  
  <p>Any example?</p>