Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class database
- {
- function __construct()
- {
- $this->dBusername = 'xxx';
- $this->dBpassword = 'xxx';
- $this->dBhost = 'localhost';
- $this->dBdatabase = 'xx';
- $this->dBcharset = 'utf8';
- }
- function register_account($username, $password, $email, $activation_id)
- {
- $mysqli = new mysqli($this->dBhost, $this->dBusername, $this->dBpassword, $this->dBdatabase);
- if(mysqli_connect_error())
- {
- return false;
- exit;
- }
- $sql = "INSERT INTO users (username, password, email, activation_id) VALUES (?, ?, ?, ?)";
- $stmt = $mysqli->prepare($sql);
- $stmt->bind_param("s, s, s, s", $username, $password, $email, $activation_id);
- $stmt->execute();
- $stmt->close();
- $mysqli->close();
- }
- function authenticate_account($username, $password)
- {
- // And so on
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement