Create account data based on servers in svr_main
This commit is contained in:
@@ -1463,10 +1463,15 @@ function saveConnectionToDatabase(client) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createDefaultAccountServerData(accountDatabaseId) {
|
function createDefaultAccountServerData(accountDatabaseId) {
|
||||||
for (let i = 1; i <= 5; i++) {
|
let dbConnection = connectToDatabase();
|
||||||
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${i})`;
|
let serversAssoc = fetchQueryAssoc(dbConnection, "SELECT * FROM svr_main");
|
||||||
|
|
||||||
|
for (let i in serversAssoc) {
|
||||||
|
let dbQueryString = `INSERT INTO acct_svr (acct_svr_acct, acct_svr_svr) VALUES (${accountDatabaseId}, ${serversAssoc[i]["svr_id"]})`;
|
||||||
quickDatabaseQuery(dbQueryString);
|
quickDatabaseQuery(dbQueryString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disconnectFromDatabase(dbConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user