I am using the ZendDb
database adapter which doesn't bring all the tweaks SQL
can do. For example if I want to do a REPLACE INTO
I would have to code it like this:
$SQL = sprintf('REPLACE INTO %s (id, NAME, cache_id, compile_id, content) VALUES (%s, %s, %s, %s, %s)' %
array(self::TABLE_NAME, $id, $name, $cache_id, $compile_id));
$this->_zdb->query($SQL);
The problem is that PhpStorm tells me that the %s
is an error inside the SQL.
When I try hotfixing it with Alt + Enter I don't get the option to suppress the inspection for this line.
I' need something like this:
/** @noinspection SqlInspection */
I googled and found this page but nothing of the options seemed to help.
Any ideas?
%s
placeholders/parameters -- quite possibly I have added it manually long time ago and it's not provided by default in your version (what PhpStorm version do you use anyway)? So ... check your patterns atSettings/Preferences | Tools | Database | User Parameters
-- see if you have\%\w+
pattern there; if you do -- what's the definition? – Doeskin<reference> expected, got %
. But I think just the correct ignore param would be ok as well :) – Kenlaysprintf
. So .. does adding such aforementioned\%\w+
pattern helps or not? – Doeskin