Answer the question
In order to leave comments, you need to log in
How to make a secure database query?
Good afternoon. Not so long ago I did a test task in one Internet agency (for the position of an intern, not even a junior), they indicated an error about unsafe access to the database on the add.php page. Now I'm just curious, how can this be done in Bitrix?
Link to the repository
Answer the question
In order to leave comments, you need to log in
CModule::IncludeModule("iblock");
$cibe = new CIBlockElement();
$cibe->Add(array(
"IBLOCK_ID" => 1,
"NAME" => $name,
"DETAIL_TEXT" => $text,
"PREVIEW_TEXT" => $text_small
));
Depending on what exactly you want to do.
If you are interested in how to do it correctly, then see the message from Ildar Gizetdinov , it is described in detail there
If you are interested in how to fix your query, then before inserting values into the query, you need to use the ForSql () method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question