Sublime Forum

ST3 SQL color with quotes

#1

Hi,

I have a slight color problem when I cut my sql string.
A picture is better than words :

The first line is OK.
But if I cut my sql query I lose the colors.
Is there a way to keep the colors of the first line in the second?

Thanks.

0 Likes

#2

SQL injection alert :skull:

image
image

0 Likes

#3

this would require some potentially complicated changes to the syntax definition

0 Likes

#4

You have nested single quotes in the second line, so a simple change to:
$sql = "select … ";
would retain the correct syntax highlighting.

0 Likes

#5

Thank you all.
Yes using a double quote will be correct in my example, but the real issue comes from using define as in Kingkeith’s example :

$query_2 = “SELECT * FROM “.DATABASE_MAIN.”.dbo.test WHERE 1=1;”;

0 Likes