The data from the form are sent through time, why?

Hello. Created common form of this kind:
<form action="add.php" method="POST">
 <input type="text" name="login">
 <input type="text" name="pass">
 <input type="submit">
</form>

File add.php writes the data in the database thus:
...........
 $sth = $db->prepare("INSERT INTO `user` SET `login` =:login, `pass` =:pass");
 $sth->execute(array('login' => $login, pass => $pass));


No errors, nothing. The records in the database making through time.

1) at First I thought that might be the problem. I spam all such data which already exist, but that role is not played.
2) thought it was due to the fact that some fields are not filled. But it too not that.

PHP and programming study recently, can't understand what's wrong. Please tell me what could be wrong?
April 4th 20 at 12:57
1 answer
April 4th 20 at 12:59
Quote lost before pass
$sth->execute(array('login' => $login, pass => $pass));

PS: Turn on --> display errors <--work will be much easier
and the colon in the array of named parameters - korbin27 commented on April 4th 20 at 13:02
About the quote, it doesn't matter, this code was drafted for example. And thanks for the link, will try later, I will unsubscribe - Kareem commented on April 4th 20 at 13:05
@Kareem, OK, waiting. - kraig85 commented on April 4th 20 at 13:08
@kraig85, all included, nothing displays. The first time I send data, all is well, they added. The second time made anything in the dB is not added and no errors no - Kareem commented on April 4th 20 at 13:11

Find more questions by tags PHP