I'm using a global PHP query in a View to find out the count of membership users. The first query, that extracts the total number of users from the database works fine, but when I use the WHERE clause in a query for a comparison with a string, I received a website error like in the image attached below.
This is the query:
<?php
$count_users_premium = db_query('SELECT COUNT(license_id) FROM {commerce_license} WHERE state="active"')->fetchField();
print $count_users_premium;
?>
So, if I want to use WHERE some_number=3, it will work, but comparison with a string didn't work. (Drupal 8 version)