Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
LOWER('%s') does not work because the percent is special to drupal and mysql, so to get a % through to mysql you need %% (an escaped %), the %s being handled by Drupal
Comments
%% here stands for %, which
%%here stands for%, which in turn is a wildcard for any number (including zero) of characters. See http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#...So,
db_query("LIKE LOWER('%%%s%%')", 'foo')would yieldLIKE LOWER('%foo%')Got it. Thanks.
Got it. Thanks.
LOWER('%s') does not work
LOWER('%s') does not work because the percent is special to drupal and mysql, so to get a % through to mysql you need %% (an escaped %), the %s being handled by Drupal