minor fixes (also removed not required field usage in insert statement)

main
hecht 10 years ago
parent c5bfc2d206
commit c13a8dd496

@ -26,7 +26,7 @@ function hasUserFreeCharSlot($user, $special = false) {
$chars = getCharsOfUser($user['id']); $chars = getCharsOfUser($user['id']);
$special_chars = 0; $special_chars = 0;
$normal_chars = 0; $normal_chars = 0;
foreach($chars as $row){ foreach($chars as $char){
if($char['rasse_a']['special']) { if($char['rasse_a']['special']) {
$special_chars++; $special_chars++;
} else { } else {
@ -88,7 +88,7 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1,
} }
} }
// Slotüberprüfung beendet! // 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.'\',' . 'values(\''.$newname.'\',' .
' '.$Starke.',' . ' '.$Starke.',' .
' '.$Verteidigung.',' . ' '.$Verteidigung.',' .
@ -98,17 +98,15 @@ function erstelleChar($user, $rassen_id, $newname = '', $picture = '', $lvl = 1,
' \''.$HP.','.$HP.'\',' . ' \''.$HP.','.$HP.'\',' .
' \''.$MP.','.$MP.'\',' . ' \''.$MP.','.$MP.'\',' .
' '.$lvl.',' . ' '.$lvl.',' .
' \''.$type.'\',' .
' \''.$rassen_id.'\',' . ' \''.$rassen_id.'\',' .
' '.$user['id'].',' . ' '.$user['id'].',' .
' \''.$c_type.'\',' .
' '.$trainingspoints.',' . ' '.$trainingspoints.',' .
' '.$LP.',' . ' '.$LP.',' .
'\''.$picture.'\', '. '\''.$picture.'\', '.
'\'0,'.calculateRequiredExpChars($lvl).'\'' . '\'0,'.calculateRequiredExpChars($lvl).'\'' .
')'; ')';
//echo $sql.'<br>'; //echo $sql.'<br>';
$identifier = mysql_query($sql); $identifier = db_query($sql);
if($identifier == FALSE){ if($identifier == FALSE){
if(mysql_fetch_assoc(mysql_query('Select id from chars where name = \''.$newname.'\''))){ if(mysql_fetch_assoc(mysql_query('Select id from chars where name = \''.$newname.'\''))){
displayErrorMessage(NULL,'Name schon vorhanden!!',displayHistoryBackLink()); displayErrorMessage(NULL,'Name schon vorhanden!!',displayHistoryBackLink());

Loading…
Cancel
Save