Load Game History Table

Click the Button: "Load Tables Now" to add this game's data to the "campaingHistoryMaster2" table.

After validating the data move, the "gameInitMasterHistory" and "gameDamageMasterHistory" tables data is deleted.

∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧∧

Record data, in record sequence, smallest to largest.

∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨∨


// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function buildInitiateTableToArray(){ $servername = "localhost"; $dbname = "quasarg1_DungensAndDragons"; $username = "quasarg1_owner"; $password = "password1"; // Create connection $conn =new mysqli($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql = "SELECT * FROM gameInitiativeHistory"; $result = mysqli_query($conn, $sql); // output data of each row $cntA = 0; while($row = mysqli_fetch_assoc($result)) { $_SESSION['gameInitMasterHistory'][$cntA][1] = $row['recNbr']; echo "recNbr " . $_SESSION['gameInitMasterHistory'][$cntA][1] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][2] = $row['mstrCnt']; echo "mstrCnt " . $_SESSION['gameInitMasterHistory'][$cntA][2] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][1][3] = $row['charId']; echo "charId " . $_SESSION['gameInitMasterHistory'][$cntA][3] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][4] = $row['charName']; echo "charName " . $_SESSION['gameInitMasterHistory'][$cntA] [4]. "
"; $_SESSION['gameInitMasterHistory'][$cntA][5] = $row['char1InitWon']; echo "char1InitWon " . $_SESSION['gameInitMasterHistory'][$cntA][5] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][6] = $row['char2InitWon']; echo "char2InitWon " . $_SESSION['gameInitMasterHistory'][$cntA][6] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][7] = $row['player1Roll']; echo "player1Roll " . $_SESSION['gameInitMasterHistory'][$cntA][7] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][8] = $row['player2Roll']; echo "player2Roll " . $_SESSION['gameInitMasterHistory'][$cntA][8] . "

"; $_SESSION['gameInitMasterHistory'][$cntA][9] = 0; echo " " . $_SESSION['gameInitMasterHistory'][$cntA][8] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][10] = 0; echo " " . $_SESSION['gameInitMasterHistory'][$cntA][10] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][11] = 0; echo " " . $_SESSION['gameInitMasterHistory'][11][$cntA] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][12] = 0; echo " " . $_SESSION['gameInitMasterHistory'][$cntA][12] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][13] = 0; echo " " . $_SESSION['gameInitMasterHistory'][$cntA][13] . "
"; $_SESSION['gameInitMasterHistory'][$cntA][14] = 0; echo " " . $_SESSION['gameInitMasterHistory'][$cntA][14] . "

"; $cntA = $cntA + 1; } $gameInitMasterHistory = $_SESSION['gameInitMasterHistory']; echo " TOTAL Array Size " . $cntA . "
"; } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function buildDamageTableToArray(){ $_SESSION['gameDamageMasterHistory'] = array(); $cntB = 0; $servername = "localhost"; $dbname = "quasarg1_DungensAndDragons"; $username = "quasarg1_owner"; $password = "password1"; // Create connection $conn =new mysqli($servername, $username, $password, $dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql = "SELECT * FROM gameHitAndDamdageHistory"; $result = mysqli_query($conn, $sql); // output data of each row while($row = mysqli_fetch_assoc($result)) { $_SESSION['gameDamageMasterHistory'][$cntB][1] = $row['recNbr']; echo "recNbr " . $_SESSION['gameDamageMasterHistory'][$cntB][1] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][2] = $row['mstrCnt']; echo "mstrCnt " . $_SESSION['gameDamageMasterHistory'][$cntB][2] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][3] = $row['charId']; echo "charId " . $_SESSION['gameDamageMasterHistory'][$cntB][3] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][4] = $row['charName']; echo "charName " . $_SESSION['gameDamageMasterHistory'][$cntB][4] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][5] = 0; echo "char1InitWon " . $_SESSION['gameDamageMasterHistory'][$cntB][5] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][6] = 0; echo "char2InitWon " . $_SESSION['gameDamageMasterHistory'][$cntB][6] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][7] = 0; echo "player1Roll " . $_SESSION['gameDamageMasterHistory'][$cntB][7] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][8] = 0; echo "player2Roll " . $_SESSION['gameDamageMasterHistory'][$cntB][8] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][9] = $row['charToHitSucced']; echo "charToHitSucced " . $_SESSION['gameDamageMasterHistory'][$cntB][9] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][10] = $row['charToHitFail']; echo "charToHitFail " . $_SESSION['gameDamageMasterHistory'][$cntB][10] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][11] = $row['charToHitPoints']; echo "charToHitPoints " . $_SESSION['gameDamageMasterHistory'][$cntB][11] . "
"; $_SESSION['gamDamageeMasterHistory'][$cntB][12] = $row['minPosPoints']; echo "minPosPoints " . $_SESSION['gamDamageeMasterHistory'][$cntB][12] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][13]= $row['maxPosPoints']; echo "maxPosPoints " . $_SESSION['gameDamageMasterHistory'][$cntB][13] . "
"; $_SESSION['gameDamageMasterHistory'][$cntB][14] = $row['oppRemHitPoints']; echo "oppRemHitPoints " . $_SESSION['gameDamageMasterHistory'][$cntB][14] . "

"; $cntB = $cntB + 1; } $gameDamageMasterHistory = $_SESSION['gameDamageMasterHistory']; echo " TOTAL Array Size " . $cntB . "
"; } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ function determineAndLoadMasterArrayToTable(){ if ($_SESSION[mstrCnt1] <= $_SESSION[mstrCnt2]){ $_SESSION['gameMasterHistory'][1][$cnt] = $row['recNbr']; $_SESSION['gameMasterHistory'][2][$cnt] = $row['mstrCnt']; // $_SESSION[mstrCnt1] = $row['mstrCnt']; $_SESSION['gameMasterHistory'][3][$cnt] = $row['charId']; $_SESSION['gameMasterHistory'][4][$cnt] = $row['charName']; $_SESSION['gameMasterHistory'][5][$cnt] = char1InitWon; $_SESSION['gameMasterHistory'][6][$cnt] = char2InitWon; $_SESSION['gameMasterHistory'][7][$cnt] = player1Roll; $_SESSION['gameMasterHistory'][8][$cnt] = player2Roll; $_SESSION['gameMasterHistory'][9][$cnt] = 0; $_SESSION['gameMasterHistory'][10][$cnt] = 0; $_SESSION['gameMasterHistory'][11][$cnt] = 0; $_SESSION['gameMasterHistory'][12][$cnt] = 0; $_SESSION['gameMasterHistory'][13][$cnt] = 0; $_SESSION['gameMasterHistory'][14][$cnt] = 0; }else{ $_SESSION['gameMasterHistory'][1][$cnt] = $row['recNbr']; $_SESSION['gameMasterHistory'][2][$cnt] = $row['mstrCnt']; $_SESSION[mstrCnt2] = $row['mstrCnt']; $_SESSION['gameMasterHistory'][3][$cnt] = $row['charId']; $_SESSION['gameMasterHistory'][4][$cnt] = $row['charName']; $_SESSION['gameMasterHistory'][5][$cnt] = 0; $_SESSION['gameMasterHistory'][6][$cnt] = 0; $_SESSION['gameMasterHistory'][7][$cnt] = 0; $_SESSION['gameMasterHistory'][8][$cnt] = 0; $_SESSION['gameMasterHistory'][9][$cnt] = $row['charToHitSucced']; $_SESSION['gameMasterHistory'][10][$cnt] = $row['charToHitFail']; $_SESSION['gameMasterHistory'][11][$cnt] = $row['charToHitPoints']; $_SESSION['gameMasterHistory'][12][$cnt] = $row['minPosPoints']; $_SESSION['gameMasterHistory'][13][$cnt] = $row['maxPosPoints']; $_SESSION['gameMasterHistory'][14][$cnt] = $row['oppRemHitPoints']; } } echo"
"; // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ?>