How to get constant string array field into db_query? First post here :)

Here's a valid MySQL query: SELECT "'a','b'" AS FieldStrArray;

(To enter as a string in PHP, remember the backslashes before double quotes.)

At least in Drupal 7's db_query(), this produces a fatal PDO exception, complaining that 'a','b' is not a known field.

My question: how do I work around this apparent limitation of db_query()/PDO?

(Yes, I need a constant string array as one of the field results. This is a minimal replication of the problem... :) )

Any suggestions MOST welcome... including a) whether this is also a problem in PHP itself, b) how to report this as a bug to the Appropriate Authorities, c) Any creative ideas for a workaround assuming it is a real bug.

Thanks!
Not sure if this is a bug or not (I've seen weird things with single and double quote in PDO queries before), but either way you can work around it by using single quotes to wrap the expression:

$sql = "SELECT '\'a\',\'b\'' AS FieldStrArray";
$val = db_query($sql)-&gt;fetchField();
// $val == "'a','b'"