Hi I have a plugin which I am running an sql statement from.
$users = craft()->db->createCommand("SELECT craft_users.id as userId, craft_users.firstName, craft_users.lastName, craft_users.email FROM craft_users INNER JOIN craft_content on craft_users.id = craft_content.elementId WHERE craft_content.field_interests LIKE '%\"8948\"%'");
The query is not returning the expected results from the createCommand function in fact it returns an empty array. But if I run it directly in the database it works perfectly and returns the entries.
I also tried building this with the query builder but it was throwing errors and not finding the user table.
LIKE
condition to a dbCommand craftcms.stackexchange.com/questions/10526/…