These lines of code gets me out this error and i cannot understand it
The signature for SelectQuery::fields() is:

public SelectQuery::fields($table_alias, array $fields = array())


So you need:

$number_to_keep = db_select('variable', 'va')
  -&gt;fields('va', array('value'))
  -&gt;condition('va.name', 'dblog_row_limit', '=')
  -&gt;execute();