thinhbdsy
08-11-10, 05:14 PM
đoạn mã của view.php
$query = "select GameID1,GameID2,GameID3,GameID4,GameID5 from AccountCharacter WHERE Id='$account'";
$result = $db->Execute( $query );
$row = $result->fetchrow();
for ($i=0;$i<5;++$i) {
if ( !empty($row[$i]) ) {
$query_info_char = $db->Execute("SELECT Class,cLevel,Strength,Dexterity,Vitality,Energy,Le adership,Resets,Relifes FROM Character WHERE Name='$row[$i]'");
$info_char = $query_info_char->fetchrow();
$class[] = $info_char[0];
$level[] = $info_char[1];
$str[] = $info_char[2];
$dex[] = $info_char[3];
$vit[] = $info_char[4];
$ene[] = $info_char[5];
$com[] = $info_char[6];
$reset[] = $info_char[7];
$relife[] = $info_char[8];
}
else { $class[] = 0; $level[] = 0; $str[] = 0; $dex[] = 0; $vit[] = 0; $ene[] = 0; $com[] = 0; $reset[] = 0; $relife[] = 0; }
và đoạn mã của ìno_char.php
for ($i = 0; $i < 5; ++$i ) {
$char_info = explode( "<nbb>", $char_info[$i] );
if($char_info[1]== $class_dw_1){ $Class= $class_dw_1_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dw_2){ $Class= $class_dw_2_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dw_3){ $Class= $class_dw_3_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dk_1){ $Class= $class_dk_1_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_dk_2){ $Class= $class_dk_2_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_dk_3){ $Class= $class_dk_3_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_elf_1){ $Class= $class_elf_1_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_elf_2){ $Class= $class_elf_2_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_elf_3){ $Class= $class_elf_3_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_mg_1){ $Class= $class_mg_1_name; $Char_Image="Magic Gladiator"; }
if($char_info[1]== $class_mg_2){ $Class= $class_mg_2_name; $Char_Image="Magic Gladiator"; }
if($char_info[1]== $class_dl_1){ $Class= $class_dl_1_name; $Char_Image="Dark Lord"; }
if($char_info[1]== $class_dl_2){ $Class= $class_dl_2_name; $Char_Image="Dark Lord"; }
if($char_info[1]== $class_sum_1){ $Class= $class_sum_1_name; $Char_Image="Summoner"; }
if($char_info[1]== $class_sum_2){ $Class= $class_sum_2_name; $Char_Image="Summoner"; }
if($char_info[1]== $class_sum_3){ $Class= $class_sum_3_name; $Char_Image="Summoner"; }
if ( !empty( $char_info[0] ) ) {
$showchar[] = array(
Name => $char_info[0],
cclass => $Class,
level => $char_info[2],
str => $char_info[3],
dex => $char_info[4],
vit => $char_info[5],
ene => $char_info[6],
com => $char_info[7],
reset => $char_info[8],
relife => $char_info[9],
sao mình chạy nó chỉ ra thông tin đúng của nv đầu tiên
con nv thứ 2 thì sai
tên nv thừ lại là class của nv1
(mình có 4 nv nhưng chỉ hiện có 2)
làm ơn chỉ giúp
$query = "select GameID1,GameID2,GameID3,GameID4,GameID5 from AccountCharacter WHERE Id='$account'";
$result = $db->Execute( $query );
$row = $result->fetchrow();
for ($i=0;$i<5;++$i) {
if ( !empty($row[$i]) ) {
$query_info_char = $db->Execute("SELECT Class,cLevel,Strength,Dexterity,Vitality,Energy,Le adership,Resets,Relifes FROM Character WHERE Name='$row[$i]'");
$info_char = $query_info_char->fetchrow();
$class[] = $info_char[0];
$level[] = $info_char[1];
$str[] = $info_char[2];
$dex[] = $info_char[3];
$vit[] = $info_char[4];
$ene[] = $info_char[5];
$com[] = $info_char[6];
$reset[] = $info_char[7];
$relife[] = $info_char[8];
}
else { $class[] = 0; $level[] = 0; $str[] = 0; $dex[] = 0; $vit[] = 0; $ene[] = 0; $com[] = 0; $reset[] = 0; $relife[] = 0; }
và đoạn mã của ìno_char.php
for ($i = 0; $i < 5; ++$i ) {
$char_info = explode( "<nbb>", $char_info[$i] );
if($char_info[1]== $class_dw_1){ $Class= $class_dw_1_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dw_2){ $Class= $class_dw_2_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dw_3){ $Class= $class_dw_3_name; $Char_Image="Dark Wizard"; }
if($char_info[1]== $class_dk_1){ $Class= $class_dk_1_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_dk_2){ $Class= $class_dk_2_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_dk_3){ $Class= $class_dk_3_name; $Char_Image="Dark Knight"; }
if($char_info[1]== $class_elf_1){ $Class= $class_elf_1_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_elf_2){ $Class= $class_elf_2_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_elf_3){ $Class= $class_elf_3_name; $Char_Image="Fairy Elf"; }
if($char_info[1]== $class_mg_1){ $Class= $class_mg_1_name; $Char_Image="Magic Gladiator"; }
if($char_info[1]== $class_mg_2){ $Class= $class_mg_2_name; $Char_Image="Magic Gladiator"; }
if($char_info[1]== $class_dl_1){ $Class= $class_dl_1_name; $Char_Image="Dark Lord"; }
if($char_info[1]== $class_dl_2){ $Class= $class_dl_2_name; $Char_Image="Dark Lord"; }
if($char_info[1]== $class_sum_1){ $Class= $class_sum_1_name; $Char_Image="Summoner"; }
if($char_info[1]== $class_sum_2){ $Class= $class_sum_2_name; $Char_Image="Summoner"; }
if($char_info[1]== $class_sum_3){ $Class= $class_sum_3_name; $Char_Image="Summoner"; }
if ( !empty( $char_info[0] ) ) {
$showchar[] = array(
Name => $char_info[0],
cclass => $Class,
level => $char_info[2],
str => $char_info[3],
dex => $char_info[4],
vit => $char_info[5],
ene => $char_info[6],
com => $char_info[7],
reset => $char_info[8],
relife => $char_info[9],
sao mình chạy nó chỉ ra thông tin đúng của nv đầu tiên
con nv thứ 2 thì sai
tên nv thừ lại là class của nv1
(mình có 4 nv nhưng chỉ hiện có 2)
làm ơn chỉ giúp