I am newbie to PhpStorm. I have a mysql-query:
$query = 'SELECT COUNT(*) FROM `FLAP_Messages` WHERE `placeId` = ? AND `type` = "orgwall" AND `Status` = ?';
And PhpStorm give me a warning - unable to resolve column "orgwall". If I change double quotes to single quotes warning disappear. How can I tell to PhpStorm to allow double quotes in string literals in MySQL queries?
How can I tell to PhpStorm to allow double quotes in string literals in MySQL queries?
Currently you cannot change this behaviour, unless you use single quotes for string values instead of double quotes.
I don't know if this is related, but since this was the first question I found on Stack Overflow related to my problem (showing backticks as errors in string literals), I'm putting my solution here.
For OSX, it was Preferences/SQL Dialect, set to MySQL
project-wide.
In phpStorm 9.0 on Ubuntu I had to change the Project SQL dialect
File > Settings > Language & Frameworks > SQL Dialects > Click Project Directory & Click SQL Dialect and change it to MySQL
This is an old subject, and good answers have already been given, but as I had the same problem, and didn't want to wrap my query in double quotes, I finally used NOWDOC syntax, like this :
$query = <<<'QUERY'
SELECT COUNT(*) FROM `FLAP_Messages` WHERE `placeId` = ? AND `type` = 'orgwall' AND `Status` = ?
QUERY;