Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $db_name = 'db_name';
  2. $hostname = 'mysql.hostinger.com.br';
  3. $username = 'username';
  4. $password = 'password';
  5.  
  6. $sql = "INSERT INTO atividade(titulo, descricao, data_atividade) VALUES(:titulo, :descricao, :data_atividade);";
  7.  
  8. try {
  9. $dbh = new PDO('mysql:host=$hostname;dbname=$db_name', $username, $password);
  10. } catch (PDOException $e) {
  11. echo 'Error: ' . $e->getMessage();
  12. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement