yesamarcos

Resolvendo script PHP !!!

Dec 29th, 2016
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. # PRIMEIRA COISA
  2. ## SE NÃO É PRA MEXER EM SENHA, NÃO COLOCA SENHA NA QUERY
  3.  
  4. public function update($id){
  5.  
  6. $sql = "UPDATE $this->table
  7. SET
  8. tipo = :tipo, nome = :nome, email = :email,
  9. cpf_cnpj = :cpf_cnpj, telefone = :telefone
  10. WHERE
  11. id = :id
  12. ";
  13.  
  14. $stmt = DB::prepare($sql);
  15.  
  16. $stmt->bindParam(':tipo', $this->tipo);
  17. $stmt->bindParam(':nome', $this->nome);
  18. $stmt->bindParam(':email', $this->email);
  19. $stmt->bindParam(':cpf_cnpj', $this->cpf_cnpj);
  20. $stmt->bindParam(':telefone', $this->telefone);
  21. $stmt->bindParam(':id', $id);
  22.  
  23. return $stmt->execute();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment