[!--quoteo(post=368075:date=Apr 24 2006, 12:53 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 24 2006, 12:53 PM) [snapback]368075[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think I found the problem... Just a minor misspelled variable in one of my examples... :-( [code]<?php $result = mysql_query("SELECT e_1, e_2, e_3, e_4, e_5, e_6, e_7, e_8, e_9, e_10 FROM f_images", $link); $num_rows = mysql_num_fields($result); $row = mysql_fetch_assoc($result); foreach($row as $k => $v) if ($v == '') $num_rows--; // I had $num_row originally echo $num_rows; ?>[/code] You can also just add up the entries which are not blank: [code]<?php $result = mysql_query("SELECT e_1, e_2, e_3, e_4, e_5, e_6, e_7, e_8, e_9, e_10 FROM f_images", $link); $num_rows = 0 $row = mysql_fetch_assoc($result); foreach($row as $k => $v) if ($v != '') $num_rows++; echo $num_rows; ?>[/code] Ken [/quote] Thank you Ken, and thank you for being so patient <3