How I can simplify this PHP code? too many switch() function
<p>I made listview in jQuery Mobile and I used PHP to feed its contents. It works properly, but the code is too long and most part of it are very similar to each other. Is there any way to simplify the code? Please have a look at the code, then I'll explain what I really need to do:</p>

<pre><code>&lt;ol data-role="listview"&gt;
            &lt;?php
            while ($row = mysql_fetch_array($result)){
                echo "&lt;li&gt;&lt;a href=\"#\"&gt;";
                // first column check
                switch ($row[1]) {
                    case "Behnam":
                        echo " B . ";
                        break;
                    case "Tarin":
                        echo " T . ";
                        break;
                }
                // second column check
                switch ($row[2]) {
                    case "Behnam":
                        echo " B . ";
                        break;
                    case "Tarin":
                        echo " T . ";
                        break;
                    default:
                        echo " N . ";
                }
                // third column check
                switch ($row[3]) {
                    case "Behnam":
                        echo " B . ";
                        break;
                    case "Tarin":
                        echo " T . ";
                        break;
                    default:
                        echo " N . ";
                }
                // fourth column check
                switch ($row[4]) {
                    case "Behnam":
                        echo " B . ";
                        break;
                    case "Tarin":
                        echo " T . ";
                        break;
                    default:
                        echo " N . ";
                }
                // fifth column check
                switch ($row[5]) {
                    case "Behnam":
                        echo " B . ";
                        break;
                    case "Tarin":
                        echo " T . ";
                        break;
                    default:
                        echo " N . ";
                }
                // sixth column check
                switch ($row[6]) {
                    case "Behnam":
                        echo " B ";
                        break;
                    case "Tarin":
                        echo " T ";
                        break;
                    default:
                        echo " N ";
                }
                echo "&lt;/li&gt;&lt;/a&gt;";
            }
            ?&gt;
            &lt;/a&gt;&lt;/li&gt;
        &lt;/ol&gt;
</code></pre>

<p>and the result is:</p>

<p><img src="http://i.stack.imgur.com/LhC24.gif" alt="enter image description here"></p>

<p>By using <code>while ($row = mysql_fetch_array($result)){</code> I can fetch each row of the sql table one by one. But I also need to check the value of each cell(column) as well.</p>
