The bind_param that is failing is this
$stmt->bind_param('ssss', $this->template->forms->reg_username, $this->template->forms->reg_password, $this->template->forms->reg_email, "Test");
the prepared statement is
$stmt = $this->mysqli->prepare("INSERT INTO 'users' (username, password, email, referr) VALUES (?, ?, ?, ?)");
The whole Register function is
public function Register() {
unset($this->template->forms->error);
$this->template->forms->setData();
if(isset($this->template->forms->submit)) {
if(!isset($this->template->forms->reg_username)) {
$this->template->forms->error = "You must enter an username";
}
if(!isset($this->template->forms->reg_password)) {
$this->template->forms->error = "You must enter a password";
}
if(!isset($this->template->forms->reg_password_confirm)) {
$this->template->forms->error = "You must confirm your password";
}
if(!isset($this->template->forms->reg_email)) {
$this->template->forms->error = "You must enter an email address";
}
if($this->template->forms->reg_password != $this->template->forms->reg_password_confirm) {
$this->template->forms->error = "Your passwords must match";
} else if(strlen($this->template->forms->reg_password) <= 5) {
$this->template->forms->error = "Your password must be 6 characters or more.";
}
if(!$this->template->forms->error) {
$stmt = $this->mysqli->prepare("INSERT INTO 'users' (username, password, email, referr) VALUES (?, ?, ?, ?)");
$stmt->bind_param('ssss', $this->template->forms->reg_username, $this->template->forms->reg_password, $this->template->forms->reg_email, "Adam");
$stmt->execute();
}
}
}
No comments:
Post a Comment