yeah, I solved it like this:
// by the way, I've got a query function with built in error
// reporting so that I can change the error mes´sage for all queries... =)
$sql = "SELECT COUNT(*) as total FROM table";
$result = sql_query($sql);
$data = mysql_fetch_object($result);
echo $data->total;
but thanks for the reply!