I'm passing insert parameters to the database using PDO and O.O, but giving the Insert command using the $stm->bindParam(1, $usuario->getnivel());
parameters returns error saying that I should only pass variables to insert.
Follow the code below:
public function cadastrar(Cadastro $usuario) {
$stm = $this->pdo->prepare('INSERT INTO usuarios (nivel,username,senha) VALUES (?,?,?)');
$stm->bindParam(1, $usuario->getnivel());
$stm->bindParam(2, $usuario->getusername());
$stm->bindParam(3, $usuario->getsenha());
$stm->execute();
}