Answer the question
In order to leave comments, you need to log in
How to protect against sql injection without oops in php?
Hello, I need to know how to protect against sql injection without oops. I don't know oops. I read early forums and articles - everyone writes different things, one is only oop safe, one is mysqli_real_escape_string. I don't know who is true and who is not. Please write to me how you can protect yourself from OOP without any php frameworks.
Answer the question
In order to leave comments, you need to log in
PDO and prepared expressions, more details - https://habr.com/post/148701/
And what about the fear of OOP?
The documentation describes how to attach parameters to a request in both the object-oriented and procedural style. You can implement communication with the DBMS in either style, if we are talking about MySQl.
php.net/manual/ru/mysqli-stmt.bind-param.php
PS: You're just afraid to learn the documentation, try different implementation examples. That's all.
Read carefully and understand how PDO works and google about prepared queries.
I hasten to please. Knowledge of OOP is not required for this. You can just do as in numerous examples, work with PDO as a tool without going into details.
Better still, take the time to learn at least the OOP syntax in PHP. It's not hard, but it will make your life a lot easier.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question