Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function conectar(){
  2. $host = "localhost";
  3. $user = "root";
  4. $pass = "";
  5. $dbname = "vcBD2";
  6.  
  7. try {
  8. $opcoes = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
  9. $pdo = new PDO("mysql:host=localhost;dbname=vcBD2;", "root", "", $opcoes);
  10. } catch (Exception $e) {
  11. echo $e->getMessage();
  12. }
  13.  
  14. return $pdo;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement