V
V
vegarulez2016-06-16 01:08:26
PHP
vegarulez, 2016-06-16 01:08:26

[PHP,SQL, update] How to properly update strings with special characters?

There is a line in the variable that contains the following expression:
...
dscr="Issued by" trg="0" req="0" mask="^[A-Yaa-yaёЁ/.\- 0-9,]{ 1,50}"
...
When I update this line to the database, I get in the database
...
dscr="Issued by" trg="0" req="0" mask="^[А-Ра-яёЁ/ .- 0-9,]{1,50}"
...
i.e. one slash in the regexp escapes.
the question is how to update correctly so that the data that was in the variable is written to the database exactly in the form in which it was in the variable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2016-06-16
@vegarulez

pdo, placeholders, prepared statements and other scary words from the manual.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question