Numbers in separate divs have default number if null
<p>I have a number i'm taking out of database, basically votes.</p>

<p>So numbers are going to be separate.</p>

<pre><code>For example [ ] = A div styled box.

And $foo = 100

it will display like this:

[ 1 ] [ 0 ] [ 0 ].

        &lt;?php
        for($i=0; $i&lt;strlen($counter); $i++) {
            echo "&lt;div class='votebg'&gt;$counter[$i]&lt;/div&gt;";
        }
        ?&gt;
</code></pre>

<p>But I made this work automatically, just by taking the INT from the database.</p>

<p>Now my int is empty, so I put up a checker to check if its empty, if it is, it will make it 0.</p>

<pre><code>if (empty($rcvotes)) {
$rcvotes = 0;
}
</code></pre>

<p>Now my page only displays a zero</p>

<pre><code>[ 0 ]
</code></pre>

<p>How do I make it so it automatically fills the missing number with a zero if not exists?</p>

<p>For example, we have 7 votes.</p>

<p>The number will display like this:</p>

<pre><code>[ 0 ] [ 0 ] [ 7 ]
</code></pre>

<p>We have 88 votes, the number will display like this:</p>

<pre><code>[ 0 ] [ 8 ] [ 8 ]
</code></pre>

<p>What is exactly the problem?</p>

<p>Thanks!</p>

<pre><code>mysql_query('SELECT FROM * `vote_count`');
$rcvotes = $row['vote_number'];
if (empty($rcvotes)) {
$rcvotes = 0;
}

$counter = strval($rcvotes);
</code></pre>
