Hey everyone,
I was just wonder how I would send a variable from one function to another.
eg.
PHP Code:
$test =' '.$this->getMaxItemCost($armymodel).' ';
function getMaxItemCost($armymodel) {
$sql_text = "SELECT id, maxitemcost FROM ".$this->TABLES['currentarmy']." WHERE id = '$armymodel'";
$data = $this->sql->Select($sql_text);
$i=0;
$test = ''.$data[$i]['maxitemcost'].'';
return $test;
}
this returns $test as 25. But then when I go to check this it doesnt seem to work.
eg.
$test = 25 and $data[$i]['cost'] is the cost of something
if ($test > $data[$i]['cost']) {
You have enough money to buy that
}else{
You dont have enough money to buy that
This always seems to return " You dont have enough money to buy that " even if cost is 10...
__________________
Websites Created;
warscope.com
ratepayers.org.nz
Last edited by lothop; 05-25-2009 at 09:58 AM..
|