Database query with like condition Currently I am using the following query to select the data from database 

$result = db_query("select data from {config} where name like '%IPPOOL_POOL%' ");
while ($row = $result-&gt;fetchObject()) {
  $ips=$row-&gt;value;
}


But this generated an error like 


  Undefined property: stdClass::$value


Please help me to implement same in Drupal 8.
According to  Drupal db_like doc page

Get a database connection injected into your service from the
container and call escapeLike() on it.

For example,
$injected_database-&gt;escapeLike($string);

Try something like:
$database = \Drupal::database();
$result = $database-&gt;select('table_name', 't')
    -&gt;fields('t', ['field_1', 'field_2'])
    -&gt;condition('field_1', &quot;%&quot; . $database-&gt;escapeLike($string) . &quot;%&quot;, 'LIKE')
    -&gt;execute()
    -&gt;fetchAll();

Read Database api in Drupal 8 for a better understanding of database query in drupal 8.