Small problem... when i query the database and there is no info to be returned, it displays nothing. I would like it to return a zero if there is no info to display. How do I do that?
mysql_connect ($host, $user, $pass);
mysql_select_db( $db );
$query = "SELECT SUM( lasthours ) AS total FROM $table where date>12030630 AND date<12030801 AND id>1";
$result = mysql_query( $query );
if ( $row = mysql_fetch_assoc( $result ) ) {
echo $row['total'];
}
It's probably simple and I just don't see it......
Thanks in advance