Dethman Posted July 14, 2008 Share Posted July 14, 2008 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 oh btw here is the echo code I am using: <?echo($amt_def2);?> Please help I do not undderstand ??? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 14, 2008 Share Posted July 14, 2008 Do a "view source" in your browser and tell us what you see? My guess is that short open tags are not enabled and any code after <? is not being parsed. Quote Link to comment Share on other sites More sharing options...
Dethman Posted July 14, 2008 Author Share Posted July 14, 2008 Sorry Guys Fixed it on my own Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 14, 2008 Share Posted July 14, 2008 What was the problem? In case someone else has a similar problem and finds your post. Ken Quote Link to comment Share on other sites More sharing options...
Dethman Posted July 14, 2008 Author Share Posted July 14, 2008 lmao Your not going to belive this I Reset the Session and it was working LOL Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.