Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm MySql Double Quotes Literal interpreted as Column Name

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?

like image 438
Stan Avatar asked Mar 22 '23 18:03

Stan


2 Answers

There is a fix for this is PHPStorm. Open

Preferences > Editor > Inspections > SQL > Unresolved reference > Checkbox - Suppress for quoted identifiers which may be treated as strings

like image 175
Acyra Avatar answered Apr 05 '23 20:04

Acyra


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.

  • http://youtrack.jetbrains.com/issue/IDEA-44162
  • http://youtrack.jetbrains.com/issue/IDEA-99644
like image 29
LazyOne Avatar answered Apr 05 '23 19:04

LazyOne