$k_query = mysqli_query($link, \"SELECT wKari1 FROM webacc WHERE wNev = \'$nev\'\");while($k_result = mysqli_fetch_array($k_query)){$query = mysqli_query($link, \"SELECT ID FROM playerek WHERE Nev = \'$name\'\");while($result = mysqli_fetch_array($query)){ if($k_result[\'wKari1\'] == 0) { mysqli_query($link, \"UPDATE webacc SET wKari1 = \'$result[\'ID\']\' WHERE wNev = \'$nev\'\"); } else { mysqli_query($link, \"UPDATE webacc SET wKari2 = \'$result[\'ID\']\' WHERE wNev = \'$nev\'\");}}}
$query = mysqli_query($link, \"SELECT ID FROM playerek WHERE Nev = \'$name\'\"); while($result = mysqli_fetch_array($query)) { $id = $result[\'ID\']; } $k_query = mysqli_query($link, \"SELECT wKari1 FROM webacc WHERE wNev = \'$nev\'\"); while($k_result = mysqli_fetch_array($k_query)) { if($k_result[\'wKari1\'] == 0) { mysqli_query($link, \"UPDATE webacc SET wKari1 = \'$id\' WHERE wNev = \'$nev\'\"); } else { mysqli_query($link, \"UPDATE webacc SET wKari2 = \'$id\' WHERE wNev = \'$nev\'\"); } }