I'm using concantCONCAT
in a join, its. It works well in phpmyadmin, then I converted it into PDO statement using db_select.
The strange thing I noticed itPHPMyAdmin, but the follwoingequivalent Drupal query is failingdoesn't work.
$query->join('taxonomy_term_data', 'td', 'sbc.tname LIKE CONCAT( td.name, "%\" ) AND td.vid = sbc.vid');
withThis query causes the following error,:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column '%' in 'on clause'
However, the following query works fine and gives me the result,.
$query->join('taxonomy_term_data', 'td', 'sbc.tname LIKE CONCAT( td.name, \'%\' ) AND td.vid = sbc.vid');
The only difference between the two queries is the string quotes,: In the first one I used double quotes to wrap % and In%; in the second one I used single quotes.
But phpmyadminPHPMyAdmin gives me the result whether the % is wrapped with single quotes, or double quotes. (Actually, it should.)
I think there is something I'm missing. I'm just curious to know what it is.