So, I'm using usercake (open source php mysql combination for user management). Anyways I've got it installed and working perfectly no problems. Since I'd like my registration to not include both a displayname and username I've removed the displayname throughout all code this includes mysqldb and any other place it is called or used in vanilla install. My old users's can still login and functional normally, however I have an error when registering new users That i can't wuite figure out (I'm fairly new to mysql/php so im hoping someone here can help me explain my log files as this is first time i've ever needed to refer to them) first here is the code to actually prepare data/insert into mysql (all escaping and cleaning left out)
$stmt = $mysqli->prepare("INSERT INTO ".$db_table_prefix."users (
user_name,
password,
email,
activation_token,
last_activation_request,
lost_password_request,
active,
title,
sign_up_stamp,
last_sign_in_stamp
)
VALUES (
?,
?,
?,
?,
'".time()."',
'0',
?,
'New Member',
'".time()."',
'0'
)");
$stmt->bind_param("sssssi", $this->username, $secure_pass, $this->clean_email, $this->activation_token, $this->user_active);
$stmt->execute();
$inserted_id = $mysqli->insert_id;
$stmt->close();
//Insert default permission into matches table
$stmt = $mysqli->prepare("INSERT INTO ".$db_table_prefix."user_permission_matches (
user_id,
permission_id
)
VALUES (
?,
'1'
)");
$stmt->bind_param("s", $inserted_id);
$stmt->execute();
$stmt->close();
So everything above I think (keyword) is all good now here the log mysql log file from when the above code is called
65 Prepare INSERT INTO uc_users (
user_name,
password,
email,
activation_token,
last_activation_request,
lost_password_request,
active,
title,
sign_up_stamp,
last_sign_in_stamp
)
VALUES (
?,
?,
?,
?,
'1365565745',
'0',
?,
'New Member',
'1365565745',
'0'
)
65 Close stmt
65 Prepare INSERT INTO uc_user_permission_matches (
user_id,
permission_id
)
VALUES (
?,
'1'
)
65 Execute INSERT INTO uc_user_permission_matches (
user_id,
permission_id
)
VALUES (
'0',
'1'
)
Now there are two things i do not understand with everything posted above the first and more relevant is why is Execute INSERT INTO uc_user (...
never called? secondly why does the rest of the code execute (and somehow take the user_id inserted into uc_user) and properly pass that into uc_user_permision_matches
?
part2 to anyone more familiar with inner working of UserCake what is this value bound to sssssi
as i can not find a reference to it elsewhere ?