From c13a8dd496a39aca761082d78f9b5365c41a607d Mon Sep 17 00:00:00 2001 From: hecht Date: Mon, 1 Dec 2014 20:53:58 +0000 Subject: [PATCH] minor fixes (also removed not required field usage in insert statement) --- ag/include/erstellfunctions.inc.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ag/include/erstellfunctions.inc.php b/ag/include/erstellfunctions.inc.php index 52751f7..13eb99b 100644 --- a/ag/include/erstellfunctions.inc.php +++ b/ag/include/erstellfunctions.inc.php @@ -26,7 +26,7 @@ function hasUserFreeCharSlot($user, $special = false) { $chars = getCharsOfUser($user['id']); $special_chars = 0; $normal_chars = 0; - foreach($chars as $row){ + foreach($chars as $char){ if($char['rasse_a']['special']) { $special_chars++; } else { @@ -88,7 +88,7 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1, } } // Slotüberprüfung beendet! - $sql = 'Insert into chars(name, starke, verteidigung, speed, glueck, ausdauer, hp, mp, level, type, rasse, besitzer, char_type, training_points, lernpunkte, bild, exp) ' . + $sql = 'Insert into chars(name, starke, verteidigung, speed, glueck, ausdauer, hp, mp, level, rasse, besitzer, training_points, lernpunkte, bild, exp) ' . 'values(\''.$newname.'\',' . ' '.$Starke.',' . ' '.$Verteidigung.',' . @@ -98,17 +98,15 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1, ' \''.$HP.','.$HP.'\',' . ' \''.$MP.','.$MP.'\',' . ' '.$lvl.',' . - ' \''.$type.'\',' . ' \''.$rassen_id.'\',' . ' '.$user['id'].',' . - ' \''.$c_type.'\',' . ' '.$trainingspoints.',' . ' '.$LP.',' . '\''.$picture.'\', '. '\'0,'.calculateRequiredExpChars($lvl).'\'' . ')'; //echo $sql.'
'; - $identifier = mysql_query($sql); + $identifier = db_query($sql); if($identifier == FALSE){ if(mysql_fetch_assoc(mysql_query('Select id from chars where name = \''.$newname.'\''))){ displayErrorMessage(NULL,'Name schon vorhanden!!',displayHistoryBackLink());