How to disable "unable to resolve column '[column]'" warning when double quoted string in SQL statement?
When I have an SQL query inside single quotes in a PHP file, if I use double quotes around text in the query, I get the warning:
"unable to resolve column '[column]'"
Here's example SQL:
SELECT "person" as objectType, .......
Where "person" is text and thus needs to be escaped with single or double quotes. The reason I don't like using single quotes to escape is that I have single quotes around the whole query, which means that I have to escape the single quotes like this:
SELECT \'person\' as objectType, .......
That's annoying because if I need to test a query in external software like Navicat, I have to go through and remove the backslashes.
How can I stop PhpStorm from generating this unnecessary warning?
Please sign in to leave a comment.
Hi there,
As I understand you have MySQL there.
The double quoted text is indeed treated as column name. At the moment there is no settings in IDE to treat them as ordinary strings:
How do you define your queries (PHP code please)?
I assume it's just an ordinary string, e.g.
If so -- try HEREDOC/NOWDOC (http://www.php.net/manual/en/language.types.string.php), e.g.