[DiscordArchive] can this work?
[DiscordArchive] can this work?
Archived author: Deleted User • Posted: 2024-08-13T15:01:42.642000+00:00
Original source
can this work?
Archived author: Deleted User • Posted: 2024-08-13T15:01:45.964000+00:00
Original source
// Create an account in TrinityCore
$tc_username = $db->sql_escape($user_row['username']);
$tc_password = sha1(strtoupper($user_row['username']) . ':' . strtoupper($user_password));
// Insert into TrinityCore database
$tc_query = "INSERT INTO account (username, sha_pass_hash) VALUES ('$tc_username', '$tc_password')";
if ($tc_db->query($tc_query) === TRUE) {
// Get the ID of the newly created account
$tc_account_id = $tc_db->insert_id;
// Update PHPBB users table with the TrinityCore account ID
$sql = "UPDATE phpbb_users SET tc_account_id = $tc_account_id WHERE user_id = " . $user_row['user_id'];
$db->sql_query($sql);
} else {
die('Error creating TrinityCore account: ' . $tc_db->error);
}
Archived author: gemini • Posted: 2024-08-13T15:07:51.883000+00:00
Original source
I don't personally know the ins and outs of trying to create accounts outside of TC server console itself- it may be more involved then what you have here.