Jump to content

[SOLVED] Cant get this to echo out properly GRR


Dethman

Recommended Posts

Hey guys I ran into a problem I am using this function to array out the players army amount of each unit

 

Heres the function:

 

<?php
//Call For Ammount Of Army
function getAmtArmy($user_id){
$q="SELECT * FROM `user_users` WHERE `userid`='$user_id'";
$v=mysql_query($q);
$row=mysql_fetch_array($v);

$returnArray = array();
    $amt_untrained=$row['untrainedTroops'];
    $amt_atk1=$row['attackTroops'];
    $amt_atk2=$row['atkTroops'];
    $amt_def1=$row['defenseTroops'];
    $amt_def2=$row['defTroops'];
    $amt_creator=$row['miner'];
    $amt_covert=$row['covertTroops'];
    $amt_farmer=$row['farmer'];
    $amt_wizzards=$row['wizzards'];
    
    $returnArray[] = number_format($amt_untrained);
$returnArray[] = number_format($amt_atk1);
$returnArray[] = number_format($amt_atk2);
$returnArray[] = number_format($amt_def1);
$returnArray[] = number_format($amt_def2);
$returnArray[] = number_format($amt_creator);
$returnArray[] = number_format($amt_covert);
$returnArray[] = number_format($amt_farmer);
$returnArray[] = number_format($amt_wizzards);

return $returnArray;
}
?>

 

Here is the call:

 

<?
list($amt_untrained,$amt_atk1,$amt_atk2,$amt_def1,$amt_def2,$amt_creator,$amt_covert,$amt_farmer,$amt_wizzards)=getAmtArmy($player['userid']);
?>

 

I cant get $amt_def2 to echo but when I do a die($amt_def2) it shows that particular amount of unit just fine

 

 

Brain Buster here :D

 

oh btw here is the echo code I am using:

<?echo($amt_def2);?>

 

Please help I do not undderstand ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.