[Solved] SQL Syntax in PHP code
Hi,
In my PHP code, I write SQL code like this :
$SQLQuery = " DELETE FROM personnes ";
$SQLQuery .= " WHERE per_id = ".$id." ";
But, PHPStorm detect warning : 'Delete' statement without 'where' clears all data in the table in the first line.
I don't want to disable this warning in all the project (!!!).
I don't find to disable this warning for this line (with a @noinspection PhpStatement tag).
Or, perhaps, PHPStorm would like to find SQL requests in an other syntax...
So where is the good way ?
Thank's for your help
F.
请先登录再写评论。
The warning can be suppressed with /** @noinspection SqlWithoutWhere */ comment.
May I suggest you avoid string concatenation altogether, as in this example?
This way PhpStorms understands your query as a whole and you can get a lot of goodies: sensible syntax highlighting and linting, auto-completion, edit fragment...