Akinn
Akinn

Reputation: 2078

special characters in sql text

I have a problem with special char in SQL queries.

So I would to insert a field "text" in a table with the command:

INSERT INTO description(Text) VALUES ('$text');

So, if in the variable $text there are special chars the query not works! How can I resolve?

Upvotes: 0

Views: 818

Answers (1)

Khurram Ali
Khurram Ali

Reputation: 1679

In MSSQL SERVER you can also do something like this

INSERT INTO description(Text) VALUES (N'$text')

Upvotes: 1

Related Questions