Advertisement
b4tut4

Untitled

Jun 11th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $host="localhost";
  5. $user="root";
  6. $pass="Rafa1997##";
  7. $dbname="ticket";
  8.  
  9. try //tente fazer a conexão com a DB
  10.  
  11.     {
  12.     $pdo= new PDO ("mysql:host=localhost;dbname=ticket;", "root", "Rafa1997##"); //crianção de objeto, parametros tipo de DB host DBname user pass
  13.     }
  14.  
  15. catch (PDOException $e)//se caso não conseguir conexão
  16.  
  17.     {
  18.            $error =$e->getMessage() ;
  19.            echo "<h3 style='text-align: center'>$error</h3>";
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement