I am retrieving a row from an SQL table using:
function fetchlevels($Competence_id){
$this->query="SELECT * FROM levels WHERE comp_id=".$_REQUEST['levels'];
$tulos=$this->suoritaKysely();
return $tulos;
}
I call the function in the index using:
$alllevels=$hr_object->fetchlevels($_GET['levels']);
$page->assign('alllevels',$alllevels);
and then in my form I want to get the value of one of the columns:
$s=$this->alllevels;
echo $s['lvl2'];
But it tells me that
Undefined index: lvl2 in C:\www\index\DevIT\forms\hr\competencelevels.php on line 6
However, when using print_r($s) I could see that there is an array with that column!
Array ( [0] => Array ( [id] => 1 [comp_id] => 1 [lvl1] => sas [lvl2] => scc [lvl3] => sxl [lvl4] => lxsi [lvl5] => azix ) )