diff --git a/ag/include/clan_chat.inc.php b/ag/include/clan_chat.inc.php
index c4e7597..4a713fd 100644
--- a/ag/include/clan_chat.inc.php
+++ b/ag/include/clan_chat.inc.php
@@ -44,7 +44,7 @@ function checkAccessRights($user_id, $clan_chat_id) {
if($user_id == NULL) {
return false;
}
- $qry = db_query('SELECT clan_chat_id FROM clan_chatroom_clans cc INNER JOIN user u ON cc.clan_id = u.clan WHERE cc.clan_chat_id = ' . $clan_chat_id . ' and u.id = ' .$user_id);
+ $qry = silent_query('SELECT clan_chat_id FROM clan_chatroom_clans cc INNER JOIN user u ON cc.clan_id = u.clan WHERE cc.clan_chat_id = ' . $clan_chat_id . ' and u.id = ' .$user_id);
if(!$qry) {
return false;
}
diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php
index a08c7af..3a446cf 100644
--- a/ag/include/clan_fights.inc.php
+++ b/ag/include/clan_fights.inc.php
@@ -468,7 +468,7 @@ function getParticipatingClanIDs($clan_challenge_id) {
function getParticipatingClanData($clan_challenge_id, $clan_id) {
$sql = 'SELECT * FROM clan_challenge_clans AS ccp WHERE clan_challenge_id = ' . $clan_challenge_id . ' AND clan_id = ' .$clan_id;
- $qry = db_query($sql);
+ $qry = silent_query($sql);
if(!$qry) {
echo $sql .'
';
}
diff --git a/ag/include/defines.inc.php b/ag/include/defines.inc.php
index 9a0e44c..986b7d4 100644
--- a/ag/include/defines.inc.php
+++ b/ag/include/defines.inc.php
@@ -59,7 +59,7 @@ function getDefines($prefix = NULL) {
}
$sql = 'SELECT * FROM defines WHERE editable = 1 AND ' . $appendix;
- $qry = db_query();
+ $qry = silent_query();
if(!$qry) {
return 'Fehler in SQL-Anweisung';
@@ -79,7 +79,7 @@ function setDefine($key, $value) {
}
// set where editable true
$sql = 'UPDATE defines SET `value` = \''.$value.'\' WHERE `key` = \''.$key.'\' AND editable = TRUE';
- $qry = db_query($sql);
+ $qry = silent_query($sql);
if(!$qry || db_affected_rows() == 0) {
return 'Konnte den define ' . $key . ' nicht auf ' . $value . ' setzen';
}
diff --git a/ag/include/event.inc.php b/ag/include/event.inc.php
index cfb32b7..2e851be 100644
--- a/ag/include/event.inc.php
+++ b/ag/include/event.inc.php
@@ -187,8 +187,6 @@ function isEventToFetchAwaiting($charid) {
function getEventIdsToFetch($char_id) {
$sql = 'SELECT event_id FROM event_chars e WHERE block_end < now() and abgeholt = FALSE AND char_id = ' .$char_id . ' ORDER BY event_id ASC';
$qry = db_query($sql);
- if(!$qry)
- echo $sql . '
';
$result = array();
while ($row = mysqli_fetch_row($qry)) {
@@ -256,8 +254,6 @@ function abholenChar(array $user, $event_id, $char_id) {
// Okay and now we want to learn the attacks :)
$sql = 'SELECT attack, count(attack) as anzahl FROM event_fight_rounds e where event_id = ' . $event_id . ' AND event_char_id = ' . $char_id . ' group by attack';
$qry = db_query($sql);
- if(!$qry)
- echo $sql .'
';
$attacken_usage = array();
while($row = mysqli_fetch_assoc($qry)) {
@@ -268,8 +264,6 @@ function abholenChar(array $user, $event_id, $char_id) {
$sql = 'UPDATE event_chars SET abgeholt = TRUE WHERE char_id = ' . $char_id . ' AND event_id = ' . $event_id;
$qry = db_query($sql);
- if(!$qry)
- echo $sql .'
';
semaphoreDown($ressource); // free the previously reserved semaphore!
return $fight_ids; // Return the fight ids that the char has participated in!
@@ -319,8 +313,6 @@ function getEventFightIds($event_id) {
function getEventFightIdsByChar($event_id, $event_char_id) {
$sql = 'SELECT event_fight_id FROM event_fight_rounds where event_id = ' . $event_id . ' AND event_char_id = ' . $event_char_id . ' AND `round` = 0 ORDER BY event_fight_id ASC';
$qry = db_query($sql);
- if(!$qry)
- echo $sql . '
';
while($row = mysqli_fetch_assoc($qry)) {
$result[]= $row['event_fight_id'];
}
@@ -331,10 +323,6 @@ function getEventFightRoundData($event_id, $event_fight_id, $round) {
$sql = 'SELECT * FROM event_fight_rounds WHERE event_id = ' . $event_id . ' AND event_fight_id = ' . $event_fight_id . ' AND `round` = ' .$round;
$qry = db_query($sql);
- if(!$qry) {
- echo $sql . '
';
- return;
- }
while($row = mysqli_fetch_assoc($qry)) {
$result[$row['event_char_id']] = $row;
}
diff --git a/ag/include/kampf_wrapper.inc.php b/ag/include/kampf_wrapper.inc.php
index 584cdf0..8e1efc9 100644
--- a/ag/include/kampf_wrapper.inc.php
+++ b/ag/include/kampf_wrapper.inc.php
@@ -20,7 +20,7 @@ function convertLearnIDToAttackID (array $learnids, $char_id) {
$sql = 'SELECT id, at_id FROM lernen WHERE id IN ('.implode(',', $learnids).') AND besitzer = ' . $char_id;
// echo $sql .'
';
- $qry = db_query($sql);
+ $qry = silent_query($sql);
if (!$qry) {
return array();
}
diff --git a/ag/include/sqlwrapper.inc.php b/ag/include/sqlwrapper.inc.php
index 1dc3bc5..9a72971 100755
--- a/ag/include/sqlwrapper.inc.php
+++ b/ag/include/sqlwrapper.inc.php
@@ -6,10 +6,18 @@
* @author hecht
*/
+function silent_query($sql) {
+ return mysqli_query($GLOBALS['main_db'], $sql);
+}
+
function db_query($sql) {
$qry = mysqli_query($GLOBALS['main_db'], $sql);
if(!$qry) {
echo $sql . '
';
+ die('Query failed: '
+ .'