SQL Formatting not working when in PHP?

Hello,

I'm trying but I'm unable to format the SQL code when it's in PHP file, is that normal?
https://jmp.sh/Kez0Ckk

I would like it to be something like this
https://jmp.sh/w0ygqKT

I understand it's basically a string so it's not recognized as mysql, is there a way to make phpstorm understand it's mysql?

0
1 comment

What sql dialect is it?

You can add e.g.  "@lang Mysql" phpdoc line comment to make this work:

 

$query = /** @lang MySQL */
"INSERT INTO" . $this->cache_table . "(file_url, file_path, apikey, created)
VALUES (%s, %s, %s, %s)
ON DUPLICATE KEY UPDATE file_path=%s";
0

Please sign in to leave a comment.