Change to the following:
PHP Code:
$totalsmilies = $DB_site->query_first("SELECT COUNT(*) AS count FROM smilie");
Then use $totalsmilies[count] in your template.
And the answer to the "why" question is simple. $DB_site->query will only prepair a cursor to a query statement, it will not retrieve any records. You will either have to build a loop to retrieve all records after that, or use query_first.