SHARE
TWEET

Untitled

a guest Aug 12th, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top