 <p>the raw query would be:</p> <pre><code>select count( filename ) from downloads; </code></pre> <p>Edit: Okay, you want to loop them onto the page:</p> <pre><code>foreach( $result as $i ) { if( !empty( $i ) ) { echo "&lt;div&gt;$i['column_name']&lt;/div&gt;"; } } </code></pre>