D
D
Dmitry Filippov2017-09-25 17:41:42
PHP
Dmitry Filippov, 2017-09-25 17:41:42

How to enter data into sql table with the required encoding?

Hello!
Problem following:
There is a site on PHP, hangs in MS Azure, on IIS. As a DB it is required to use MS SQL. When entering data (Cyrillic), krakozyabry appears in the table.
How can this be fixed?
The site is in utf8, utf8 is also registered in web.config, the database is in Cyrillic_General_CI_AI.
Request:

INSERT INTO tRequest (UniversityID, FirstName, LastName, Email, RequestAnswer, RequestDate, Status, Skills) VALUES ('$uid', N'$fname', N'$lname', '$email', N'$answer', GETDATE(), 'New', N'$skills')

The most interesting thing is that when outputting data from the table, the Cyrillic alphabet is displayed normally, but the bugs in the database hurt the eyes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Budaev, 2017-09-25
@Markus_Kane

Add to the line In general, it is better, of course, to put things in order with the encoding in the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question