Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
- if (!$this->db_connection->set_charset("utf8")) {
- $this->errors[] = $this->db_connection->error;
- }
- if (!$this->db_connection->connect_errno) {
- $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));
- $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));
- $user_password = $_POST['user_password_new'];
- $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);
- $sql = "SELECT * FROM users WHERE user_name = '" . $user_name . "' OR user_email = '" . $user_email . "';";
- $query_check_user_name = $this->db_connection->query($sql);
- if ($query_check_user_name->num_rows == 1) {
- $this->errors[] = "Sorry, that username / email address is already taken.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement