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']);
$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.'<br>';
$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());

Loading…
Cancel
Save