PHP Code:
where CHAR_NAME=?",array($user_auth_id));
You are trying add Master Level to Account Name not Character Name.
PHP Code:
insert into T_MasterLevelSystem (CHAR_NAME,ML_POINT)VALUES(?,?)",array($user_auth_id));
You are trying to insert data into masterlevel table, expecting 2 values (only 1 given and again, it's wrong (account name))
PHP Code:
$check_for_memb_id = $core_db2->Execute("Select Name from Character where AccountID=?",array($user_auth_id));
You are checking if character exist? then wtf you requested? reset from no-where?
Use some logic like you can see on example
PHP Code:
// Clear Skills (null won't be fine for every server files, so in case of problems use str-repeat or full code)
$clear_skills = $core_db->Execute("Update Character set [MagicList]=CONVERT(varbinary(450), null) where mu_id=?", array($id));
// Retrieve Character Name for ML Data
$character_name = $core_db->Execute("Select Name from Character where mu_id = ?", array($id));
$character = $character_name->fields[0];
// Check If ML Data exist
$check_mldata = $core_db->Execute("Select * from T_MasterLevelSystem where CHAR_NAME = ?",array($character));
if($check_mldata->EOF) {
// Does not exist, so no need to update, let's set true
$set_mldata = true;
} else {
// Exist ? Let's restore ml points?
$set_mldata = $core_db->Execute("Update T_MasterLevelSystem set ML_POINT = MASTER_LEVEL where CHAR_NAME=?",array($character));
}
if($clear_skills && $set_mldata)