Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once ('../Database/DBConnection.php');
- class DBConnection {
- //put your code here
- private $host;
- private $user;
- private $pass;
- private $database;
- private $conn;
- function DBConnection() {
- $this->host = 'localhost';
- $this->user = 'root';
- $this->pass = '';
- $this->database = 'woodlands_away';
- }
- public function getConnections() {
- $this->conn = new mysqli($this->host, $this->user, $this->pass, $this->database) or
- die($this->conn->error);
- return $this->conn;
- }
- include_once ('../Database/DBConnection.php');
- class Admin extends DBConnection {
- public function Admin() {
- parent::DBConnection();
- }
- public function signup($username, $password) {
- $sql = "insert into users values(".$username.", ".$password.")";
- return $this->getConnections()->query($sql);
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement