i can try to update the attempt to login in mongodb but it can showing error in php with my sql i can use this code:
$columns = "";
foreach($toUpdate as $k => $v){
$columns .= "$k = :$k, ";
}
$columns = substr($columns, 0, -2); // Remove last ","
$sql = $this->dbh->prepare("UPDATE user SET {$columns} WHERE id=:id");
$sql->bindValue(":id", $user);
foreach($toUpdate as $key => $value){
$value = htmlspecialchars($value);
$sql->bindValue(":$key", $value);
}
$sql->execute();
in this code it can display no.of attempt to login..but can write this code in php with mongodb it can showing error
$columns = "";
foreach($toUpdate as $k => $v){
$columns .= "$k = :$k, ";
}
$columns = substr($columns, 0, -2); // Remove last ","
$collection=user;//table name;
$set = array('$set' =>array(array($columns)));
$m->$collection->update(array(id=>$user),$set);
foreach($toUpdate as $key => $value)
{
var_dump($toUpdate);
$value = htmlspecialchars($value);
$m->$collection->update(array(id=>$value),$set);
}
i can try many way but it show error ....this is error
Uncaught exception 'MongoWriteConcernException' with message 'localhost:27017: Modifiers operate on fields but we found type array instead. For example: {$mod: {: ...}} not {$set: [ [ "attempt = :attempt" ] ]})
any one can know how to solve this