What's wrong with this?
$db = new mysqli("DBserver","username","password","database");
if ($db->connect_error) {
die('Connect Error ('.$db->connect_errno.')'.$db->connect_error);
class registerInvitedUser {
protected $formdata = array();
protected $connection;
protected $execute;
protected $results;
protected $response_code = "";
protected $response_msg = "";
public function __construct($db)
{
$this->connection = $db;
}
$this->execute = $this->connection->query("UPDATE `users` SET acctstatus= 'A' WHERE email = '".$formdata["email"]."'");
$this->results = $this->execute->affected_rows;
if ($this->results == 1) {
$echo "user updated!";
$this->response_code = '0';
$this->response_msg .= 'Your account has successfully been created! You may now <A HREF="loginform.php">click here</A> to log in with your username and password';
}
}
The query executes and successfully updates the database, but the affected_rows conditional isn't getting tripped, and I haven't been able to figure out why.
Thanks for any suggestions you guys might have!