code: public function count($table, $search, $where = '')
      {
          if (empty($where)) {
              $where = 'WHERE';
          } else {
              $where = (stripos($where, 'WHERE') === false) ? "WHERE {$where} AND" : "{$where} AND";
          }
  
          return $this->db->value("SELECT COUNT(*) FROM {$table} AS s {$where} s.{$table} MATCH ?", $search);
      }
docs: Get the total number of search results.
  
  @param string $table  The database table name.
  @param string $search The search term(s) to '**MATCH**'.
  @param string $where  An additional string of restrictions you would like to place. If you don't include '**WHERE**' we will add it for you. If you are combining tables to deliver results then put your '**INNER JOIN ... WHERE**' clause here, and prefix the search **$table** and fields with '**s.**' eg. ``INNER JOIN my_table AS my ON s.docid = my.id WHERE my.field = ...``
  
  @return int The total count.
  
  @example
  
  ```php
  echo $db->fts->count('results', 'fish'); // 2
  ```