Guest User

Untitled

a guest
Dec 4th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. $db_host = 'localhost';
  4. $db_name = 'znzpromo_subscriptions';
  5. $db_user = 'znzpromo';
  6. $db_pass = 'eastandw';
  7.  
  8. $dbh = new PDO("mysql:host=$db_host; dbname=$db_name;", $db_user, $db_pass);
  9. $sql = "SELECT * FROM Subscriptions";
  10. $sth = $dbh->prepare($sql);
  11. $result=$sth->execute();
  12. $result = $sth->fetchAll(PDO::FETCH_ASSOC);
  13.  
  14. echo $result[0]['Name'];
  15.  
  16. ?>
Add Comment
Please, Sign In to add comment