 <p>You can do it using <code>IF/ELSE</code> conditions.</p> <p>Try</p> <pre><code>&lt;?php $query = $connection-&gt;query('SELECT * FROM users'); while($r = $query-&gt;fetch()) { if($r['status'] == 1) $r['status'] = 'yes'; if($r['status'] == 0) $r['status'] = 'no'; echo "&lt;tr&gt; &lt;td class=\"danger\"&gt;$r[id]&lt;/td&gt; &lt;td class=\"success\"&gt;$r[username]&lt;/td&gt; &lt;td class=\"warning\"&gt;$r[email]&lt;/td&gt; &lt;td class=\"info\"&gt;$r[status]&lt;/td&gt; &lt;/tr&gt;"; } ?&gt; </code></pre>