$connect = mysqli_connect('localhost','website','Bojan123321!!','website');
$query = $connect->query('SELECT `rank_id`,`RankName`,`RankSlika`,`RankInfo`,`RankKit`,`RankCommands` FROM rankovi ORDER BY `rank_id`') or die();
while($rankovi = mysqli_fetch_assoc($query)){
$RankName = $rankovi['RankName'];
$RankSlika = $rankovi['RankSlika'];
$RankInfo = $rankovi['RankInfo'];
$RankKit = $rankovi['RankKit'];
$RankCommands = $rankovi['RankCommands'];
$kits = $connect->query("SELECT * FROM kits WHERE `kit_name` = '$RankKit'");
$kitshow = mysqli_fetch_array($kits);
$KitHat = $kitshow['hat'];
$KitHatLocation = $kitshow['hatlocation'];
$KitChestPlate = $kitshow['chestplate'];
$KitChestPlateLocation = $kitshow['chestplatelocation'];
$KitLeggings = $kitshow['leggings'];
$KitLeggingsLocation = $kitshow['leggingslocation'];
$KitBoots = $kitshow['boots'];
$KitBootsLocation = $kitshow['bootslocation'];
$KitSword = $kitshow['sword'];
$KitSwordLocation = $kitshow['swordlocation'];
$KitAxe = $kitshow['axe'];
$KitAxeLocation = $kitshow['axelocation'];
$KitPickAxe = $kitshow['pickaxe'];
$KitPickAxeLocation = $kitshow['pickaxelocation'];
$KitShowel = $kitshow['showel'];
$KitShowelLocation = $kitshow['showellocation'];
$KitEncApple = $kitshow['encapple'];
$KitEncAppleLocation = $kitshow['encapplelocation'];
$KitBow = $kitshow['bow'];
$KitBowLocation = $kitshow['bowlocation'];
$KitSteak = $kitshow['steak'];
$KitSteakLocation = $kitshow['steaklocation'];
$KitDmd = $kitshow['dmd'];
$KitDmdLocation = $kitshow['dmdlocation'];
$KitIron = $kitshow['iron'];
$KitIronLocation = $kitshow['ironlocation'];
$KitGold = $kitshow['gold'];
$KitGoldLocation = $kitshow['goldlocation'];
$array = array(
$KitHat => $KitHatLocation,
$KitChestPlate => $KitChestPlateLocation,
$KitLeggings => $KitLeggingsLocation,
$KitHat => $KitBootsLocation,
$KitSword => $KitSwordLocation,
$KitAxe => $KitAxeLocation,
$KitPickAxe => $KitPickAxeLocation,
$KitShowel => $KitShowelLocation,
$KitEncApple => $KitEncAppleLocation,
$KitBow => $KitBowLocation,
$KitSteak => $KitSteakLocation,
$KitDmd => $KitDmdLocation,
$KitIron => $KitIronLocation,
$KitGold => $KitGoldLocation,
);
echo print_r($array) . "<br><br><br>";
你能告诉我哪里有问题,这个数组不会打印$ KitHat - 位置,$ KitChestPlate - 位置,$ KitLeggings - 位置。 正确添加数据库中的所有内容。 当我在'某事'中更改$ RankHat时,它将显示$ RankHitLocation。 其他
相同