A
A
Alexander Sharomet2015-07-30 13:40:20
PHP
Alexander Sharomet, 2015-07-30 13:40:20

Can such a record protect against sql injections and other PDO evil spirits?

Hello.
Recently I started to study PDO and found such information that in such a record it is unnecessary to shield the POST request from all evil spirits and injections. Is this true?

$sth=$this->db->prepare("SELECT id FROM users WHERE login=:login AND password=MD5(:password)");
$sth->execute(array(
  ':login'=>$_POST['login'],
  ':password'=>$_POST['password']
));

In this example, I don't check post login, is that correct?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ivanov, 2015-07-30
@sharomet

PDO does everything for you . This has already happened.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question