Advertisement
Guest User

Untitled

a guest
Aug 12th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <?php //update no banco de dados mysql
  2. $dsn="mysq:dbname=blog;host=localhost";
  3. $dbuser="root";
  4. $dbpass="";
  5. try{
  6.  
  7. $pdo=new PDO($dsn,$dbuser,$dbpass);
  8.  
  9. $sql="UPDATE usuarios SET email ='testes@suporte.com' WHERE email='claudinei@teste' " ;//query
  10. $sql=$pdo->query($sql);
  11. echo "usuario alterado com sucesso!";
  12.  
  13. }catch(PDOException $e){
  14. echo "conexao falhou!".$e->getMessage();
  15.  
  16.  
  17. }
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement