|
|
|
@ -113,19 +113,20 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
|
|
|
|
|
$sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)';
|
|
|
|
|
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_1['id'].',\''. $chara_1['hp'].'\', \''. $chara_1['mp'].'\', '. $chara_1['starke'].', '. $chara_1['speed'].', '. $chara_1['verteidigung'].', '. $chara_1['glueck'].', '. $chara_1['ausdauer'].', '. ($roundsArray[$round]['atk_char1']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char1'].'\'' ).', '. ($roundsArray[$round]['dmg_char1']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char1'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
|
|
|
|
|
|
|
|
|
|
echo $sql .'<br>';
|
|
|
|
|
|
|
|
|
|
mysql_query($sql);
|
|
|
|
|
$res = mysql_query($sql);
|
|
|
|
|
if(!$res)
|
|
|
|
|
echo $sql .'<br>';
|
|
|
|
|
// now persist char2
|
|
|
|
|
$chara_2 = $roundsArray[$round]['char2_array'];
|
|
|
|
|
|
|
|
|
|
$sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)';
|
|
|
|
|
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_2['id'].',\''. $chara_2['hp'].'\', \''. $chara_2['mp'].'\', '. $chara_2['starke'].', '. $chara_2['speed'].', '. $chara_2['verteidigung'].', '. $chara_2['glueck'].', '. $chara_2['ausdauer'].', '. ($roundsArray[$round]['atk_char2']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char2'].'\'' ).', '. ($roundsArray[$round]['dmg_char2']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char2'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
|
|
|
|
|
|
|
|
|
|
echo $sql .'<br>';
|
|
|
|
|
|
|
|
|
|
mysql_query($sql);
|
|
|
|
|
}
|
|
|
|
|
$res = mysql_query($sql);
|
|
|
|
|
if(!$res)
|
|
|
|
|
echo $sql .'<br>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Okay now do we have any additional data left?
|
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
|