From 0822d24b465885090aa49b4fc88731203ae00f80 Mon Sep 17 00:00:00 2001 From: hecht Date: Fri, 18 Nov 2011 07:26:13 +0000 Subject: [PATCH] fix: now assigning chars is possible again, no logging of sql-statements if the sql-statement was executed correctly! --- ag/include/clan_fights.inc.php | 8 +++++--- ag/include/event.inc.php | 13 +++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php index b1a196b..f1d92e8 100644 --- a/ag/include/clan_fights.inc.php +++ b/ag/include/clan_fights.inc.php @@ -467,7 +467,6 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) { return 'Konnte den Char nicht hinzufügen. Da du schon einen Char angemeldet hast!'; } - if($forced && isForceForCharAcknowledged($char['id'])) { } @@ -485,8 +484,11 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) { semaphoreDown($ressource2); return 'Du kannst den Char nicht zuweisen, da die maximale Anzahl der Zuweisungen schon erreicht ist!'; } - - mysql_query('INSERT INTO clan_challenge_participants(clan_challenge_id, clan_id, char_id, slot, forced) values('.$clan_challenge_id.', '.$user['clan'].', '.$charid.', '.$slot.', ' .$forced .')'); + $sql = 'INSERT INTO clan_challenge_participants(clan_challenge_id, clan_id, char_id, slot, forced) values('.$clan_challenge_id.', '.$user['clan'].', '.$charid.', '.$slot.', ' .($forced?'TRUE':'FALSE') .')'; + $res = mysql_query($sql); + if(!$res) { + echo $sql .'
'; + } if(mysql_affected_rows() == 0) { if(!$forced) { // maybe the leader has already assigned the char and we now give the official okay for that! diff --git a/ag/include/event.inc.php b/ag/include/event.inc.php index afcb5ca..73a96e8 100644 --- a/ag/include/event.inc.php +++ b/ag/include/event.inc.php @@ -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 .'
'; - mysql_query($sql); + $res = mysql_query($sql); + if(!$res) + echo $sql .'
'; // 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 .'
'; - - mysql_query($sql); - } + $res = mysql_query($sql); + if(!$res) + echo $sql .'
'; + } // Okay now do we have any additional data left? foreach ($data as $key => $value) {