Hey guys and gals, I checked the net trying to find how to return multiple variables and they said to return it as an array.
This is what Ive got.
PHP Code:
function displayProblems($newsize) {
$sql_text = "SELECT points FROM ".$this->TABLES['limits']." WHERE points = '$newsize'";
$data = $this->sql->Select($sql_text);
$i=0;
list($core, $lord) = f();
$str .=' core -'.$core.' lord -'.$lord.'';
return $str;
}
function f() {
$sql_text = "SELECT type FROM ".$this->TABLES['currentarmy']."";
$data = $this->sql->Select($sql_text);
$i=0;
$len = count($data);
$core=0;
$lord=0;
for ($i=0; $i< $len; $i++) {
switch($data[$i]['type']){
case 'core':$core=($core+1);break;
case 'lord':$lord=($lord+1);break;
}
}
return array ($core, $lord);
}
But I keep getting Fatal error: Call to undefined function f() in functions.php on line 79. Any ideas?
__________________
Websites Created;
warscope.com
ratepayers.org.nz
|