Remove Border from the last li Element of an Unordered List
<p>I have an <strong>ul list</strong> with a query and a while loop displaying the <strong>li's</strong> inside.</p>

<p>Each li has a border bottom. I need to find a way to make the last li not have a border.</p>

<p>Here is what I am thinking:</p>

<pre><code>&lt;ul&gt; 

$z = '0'; 

$anchors2 = mysql_query("SELECT * FROM anchors WHERE site_url = '$site_current2'  AND site_type = 'slave' LIMIT 999 OFFSET 9"); 

while($anc2 = mysql_fetch_assoc($anchors2)){

    $z++;

    $s_anchor2 = $anc2['site_anchor']; 

    $s_current2 = $anc2['site_current'];

    if ($z != $total_number_of_rows){ // How can I get the total number of queried rows?

        echo '&lt;li&gt;&lt;a href="'.$s_current2.'" title="'.$s_anchor2.'" target="_self"&gt;'.$s_anchor2.'&lt;/a&gt;&lt;/li&gt;';             

   } else {

        echo '&lt;li style="border-bottom:none"&gt;&lt;a href="'.$s_current2.'" title="'.$s_anchor2.'" target="_self"&gt;'.$s_anchor2.'&lt;/a&gt;&lt;/li&gt;';  
                    }                   
   }

&lt;/ul&gt;
</code></pre>

<p>*<strong>*The problem is I need a way to find out the total number of rows in order to make my code work and remove the border of the last li</strong></p>

<p>Any ideas?</p>

<p>Just tried it with jquery which I new to me. I have several ul lists and here is the code:</p>

<pre><code>function last_li_remove_border() {
    $("ul.no_border_last_li li:last").each(function() {
        css({border:'none'});
    });
}
</code></pre>

<p>How can i make it work?</p>

<p>Ty for the answers:)</p>
