public function affected_rows() { return is_object($this->result_id) ? $this->result_id->rowCount() : 0; }