# Retrieve the number of records in a table

## How to know the number of results in a table ?

Each collector can call the method getCount used to count the number of records in a table.

`` function getCount(\$conditions=array(), \$sql = null) { }``

## Settings

1. \$conditions : a table which includes the conditions of recovery.
2. \$sql : an SQL query (string).

## Example

The following example allows you to retrieve the number of records in the table "example" if the field "category" of the records has a value of "example".

``````\$conditions = array('category' => 'example');
\$result = \$this->collector['example']->getCount(\$conditions);``````

## The function's return

This method returns a number or NULL.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6641997,"math_prob":0.8662462,"size":675,"snap":"2020-45-2020-50","text_gpt3_token_len":148,"char_repetition_ratio":0.16393442,"word_repetition_ratio":0.048076924,"special_character_ratio":0.24444444,"punctuation_ratio":0.09565217,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9811437,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-22T17:51:43Z\",\"WARC-Record-ID\":\"<urn:uuid:ee27efb8-7e68-4d49-a530-9cfe375e972b>\",\"Content-Length\":\"7735\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1023f2b1-29e3-443e-a10d-c1926005e69b>\",\"WARC-Concurrent-To\":\"<urn:uuid:9978aee7-8194-44a5-accd-93641fd720ce>\",\"WARC-IP-Address\":\"195.154.29.30\",\"WARC-Target-URI\":\"https://gabox.io/en/news/recuperer-le-nombre-de-resultats-d-une-requete-sql.html\",\"WARC-Payload-Digest\":\"sha1:D63OTUAXI2GKIIZEH2ILCL66AAJK7QJW\",\"WARC-Block-Digest\":\"sha1:UHFHVQ2NTEWOLQVQULSLYBLBWX2QKFAU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107880014.26_warc_CC-MAIN-20201022170349-20201022200349-00463.warc.gz\"}"}