So I am working on a project using UserCake. I have added fields to the 'users' table. So far, everything works great. The issue I am having is when you register, it returns successful but the SQL statement did not put any of the form data into the database.
So far, I have been successful at adding the necessary fields and I am able to pull data from those fields however, I am not able to push data to the database. I have a feeling it has to do with the bind_param statement, but I am not sure. Here's what I am dealing with:
EDIT 9/30 5pm >>> Only issue at this point is that the data is not being put into the table.
$stmt = $mysqli->prepare("INSERT INTO ".$db_table_prefix."users (
password,
email,
activation_token,
last_activation_request,
lost_password_request,
active,
title,
sign_up_stamp,
last_sign_in_stamp,
company,
address_1,
address_2,
city,
state,
zip,
paid,
first_name,
last_name
)
VALUES (
?,
?,
?,
'".time()."',
'0',
?,
'New Member',
'".time()."',
'0',
?,
?,
?,
?,
?,
?,
'0',
?,
?
)");
$stmt->bind_param("sssisssssiiss", $secure_pass, $this->clean_email, $this->activation_token, $this->user_active, $this->company, $this->address_1, $this->address_2, $this->city, $this->state, $this->zip, $this->first_name, $this->last_name);
$stmt->execute();
print_r($stmt);
$inserted_id = $mysqli->insert_id;
$stmt->close();
EDIT >>> Solved empty array issue
I am calling the new user like this: $user = new User($password, $email, $token, $activationRequest, $passwordRequest, $active, $title, $signUp, $signIn, $company, $address_1, $address_2, $city, $state, $zip, $paid, $first_name, $last_name);
EDIT >>>
TABLE uc_users
(
id
int(11) NOT NULL,
password
varchar(225) NOT NULL,
email
varchar(150) NOT NULL,
activation_token
varchar(225) NOT NULL,
last_activation_request
int(11) NOT NULL,
lost_password_request
tinyint(1) NOT NULL,
active
tinyint(1) NOT NULL,
title
varchar(150) NOT NULL,
sign_up_stamp
int(11) NOT NULL,
last_sign_in_stamp
int(11) NOT NULL,
company
varchar(50) DEFAULT NULL,
address_1
varchar(50) NOT NULL,
address_2
varchar(50) NOT NULL,
city
varchar(50) NOT NULL,
state
varchar(20) NOT NULL,
zip
int(5) NOT NULL,
paid
tinyint(1) NOT NULL,
first_name
varchar(50) NOT NULL,
last_name
varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;