Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DB
- {
- public $host = 'localhost';
- public $username = 'aaron_aaron';
- public $pass = 'd6G4X5S54';
- public $dbname = 'aaron_aaron';
- public function __construct()
- {
- try {
- $this->db = new PDO("mysql:host=$this->host;dbname=$this->dbname",$this->username,$this->pass);
- }
- catch (PDOException $e){
- echo $e->getMessage();
- }
- }
- public function members($members)
- {
- try
- {
- $stmt = $this->db->prepare("SELECT displayname FROM members");
- $stmt->execute();
- $userRow = $stmt->fetch(PDO::FETCH_ASSOC);
- }
- catch (PDOException $e){
- echo $e->getMessage();
- }
- }
- }
- $conn = new DB();
- ?>
Add Comment
Please, Sign In to add comment