From e510b1a5415a9507e64cb55065984eaa8bad5acf Mon Sep 17 00:00:00 2001 From: hecht Date: Fri, 22 Aug 2014 10:12:02 +0000 Subject: [PATCH] liga und wanted gingen dann doch noch nicht --- cronjob/liga1.php | 6 ++++-- cronjob/wanted.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cronjob/liga1.php b/cronjob/liga1.php index 0757b80..d2f2088 100644 --- a/cronjob/liga1.php +++ b/cronjob/liga1.php @@ -9,6 +9,7 @@ include('db.php'); include('path.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); +include_once(ROOT_PATH.'/include/sqlwrapper.inc.php'); set_time_limit(0); function rand_array($array) @@ -36,13 +37,14 @@ foreach($races as $race) { $exclude_race_ids[] = '\''.$race['id'].'\''; } -$max_charakter = mysql_num_rows(mysql_query('SELECT id FROM chars WHERE rasse NOT IN ('.implode(',', $exclude_race_ids).') LIMIT 250')); +$max_charakter = mysql_num_rows(db_query('SELECT id FROM chars WHERE rasse NOT IN ('.implode(',', $exclude_race_ids).') LIMIT 250')); if($max_charakter<250) { + echo "Not enough chars ($max_charakter)"; exit; } -$charakter = mysql_query('SELECT name, id FROM chars WHERE rasse NOT IN '.implode(',', $exclude_race_ids).' ORDER BY level DESC LIMIT '.$max_charakter); +$charakter = db_query('SELECT name, id FROM chars WHERE rasse NOT IN('.implode(',', $exclude_race_ids).') ORDER BY level DESC LIMIT '.$max_charakter); diff --git a/cronjob/wanted.php b/cronjob/wanted.php index aaa7e5a..c08b4fc 100644 --- a/cronjob/wanted.php +++ b/cronjob/wanted.php @@ -43,7 +43,7 @@ if($max_charakter<500) { exit; } -$charakter = mysql_query('SELECT name, id FROM chars WHERE rasse NOT IN '.implode(',', $exclude_race_ids).' ORDER BY level DESC LIMIT '.$max_charakter); +$charakter = mysql_query('SELECT name, id FROM chars WHERE rasse NOT IN ('.implode(',', $exclude_race_ids).') ORDER BY level DESC LIMIT '.$max_charakter);