The Problem:
I am using a framework which at many points provides queries just like this one:
$sql = "select $sArticleTable.* from table_A left join " .
"$sArticleTable on table_A.objectid=$sArticleTable.id " .
"where table_A.articlenid = $sArticleId " .
"and $sArticleTable.id is not null and " . $object->someMoreSQL() .
"order by table_A.sort";
As you can see, one table name gets inserted via the $sArticleTable
variable. Even though I highly detest this way of writing up an MySQL statement, there is nothing right now I can do about it.
This way of writing up the statement prevents PhpStorm from recognizing the table name correctly, so no autocomplete suggestions are being shown.
How can I give PhpStorm a placeholder value for the variable $sArticleTable
so that it will in turn again provide autocomplete suggestions?
I have tried Database -> User Parameters
in the settings, but I do not get prompted to enter a placeholder value.
I also know that I could simply replace the variable with the correct table name, adjust the SQL and then re-enter the variable. But this seems rather unprofessional, given that I think PhpStorm might provide the solution here.
Furthermore, since I am already adjusting the SQL, I could very well rewrite the statement in a more fitting way. Which, with a relatively small statement such as this, I might end up doing. There are however much larger statements that would eat up way to much time to rewrite.