PHP echo code not returning '0' if no results
<p>Here is the query:</p>

<pre><code>$query = "SELECT name,deleted,COUNT(message) as message FROM guestbook_message WHERE name='".$name."' AND deleted=1 GROUP BY name";  
$result = mysql_query($query) or die(mysql_error());
$deletedtotal_row = mysql_fetch_array($result);
</code></pre>

<p>Here when I use it:</p>

<pre><code>echo "You have had ".($deletedtotal_row['deleted']) ? $deletedtotal_row['deleted'] : '0'." messages deleted";
</code></pre>

<p>This errors, doesn't show an syntax error, but doesn't display any results.</p>

<p>But when I use:</p>

<pre><code>echo ".$totaldeleted_row['deleted'].";
</code></pre>

<p>It works fine. But if there is no messages deleted for that user, it returns nothing, but I want it to display '0'.</p>

<p>Any ideas where I'm going wrong?</p>
