Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Connection {
- protected $host = "localhost";
- protected $dbname = "aaron_aaron";
- protected $user = "aaron_aaron";
- protected $pass = "d6G4X5S54";
- protected $DBH;
- function __construct()
- {
- try {
- $this->DBH = new PDO("mysql:host=$this->host;dbname=$this->dbname", $this->user, $this->pass);
- }
- catch (PDOException $e)
- {
- echo $e->getMessage();
- }
- }
- public function getMembers()
- {
- $sth = $dbh->prepare("SELECT * FROM members");
- $sth->execute();
- $result = $sth->fetchAll();
- }
- }
- $dbh = new Connection($host,$dbname,$user,$pass);
- var_dump($result);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement