Duplicate data displayed in PHP page
<p>I am working on a project with PHP.  I have a php page which displays single row two times in web page.  Whereas there is no duplicate data in the table of database. Plz help me out !!!!!
Here is two tables and php Code...</p>

<pre>
maincat_desktop
--------------------
maincat_id  maincat_nm
    1       Desktop
    2       Leptop
</pre>

<pre>
**subcat_desktop**
--------------------
subcat_id   maincat_id    subcat_nm1    subcat_disc subcat_amt  subcat_prod_img subcat_nm
        1   1             Acer123           ABCEDFG 25000       NULL            Acer
        2   1             Dell123           ABCEDFG 8000        NULL            Dell
        3   1             ompaq123          ABCEDFG 12000       NULL            Compaq
        4   1             Lenovo123         ABCEDFG 32000       NULL            Lenovo
        5   1             HP123             ABCEDFG 18000       NULL            HP
        6   1             Toshiba123        ABCEDFG 45000       NULL            Toshiba
</pre>

<pre><code>&lt;html&gt;
&lt;?php

    $query = mysql_query("select c.maincat_nm,c.maincat_id,s.subcat_nm1,s.subcat_disc,s.subcat_id,s.subcat_amt,s.subcat_prod_img from maincat_desktop c, subcat_desktop s where s.subcat_nm like '%Acer%'");

        while ($row = mysql_fetch_array($query))
        {
            if(mysql_affected_rows()&lt;0)
            {
                echo "No data found";
            }
            else
            {
                echo "&lt;table border=0 width=80% style='border-bottom:1px solid grey' align=center&gt;";
                echo "&lt;tr height='80px'&gt;";
                echo "&lt;td rowspan=20 width='80px'&gt;&lt;img src='admin/upload/".$row['subcat_prod_img']."' width='70' heigth='70' style='vertical-align:middle'&gt;";
                echo "&lt;/td&gt;";
                echo "&lt;td&gt;";

                echo "&lt;a href='acer_desktop_discription.php?subcat_id=$row[subcat_id]' style=color:blue&gt;&lt;b&gt;".$row['subcat_nm1']."&lt;/b&gt;&lt;/a&gt;";
                echo "&lt;/td&gt;";
                echo "&lt;/tr&gt;";
                echo "&lt;/table&gt;";
            }
        }

            echo "&lt;br&gt;";

?&gt; &lt;/html&gt;
</code></pre>
