query( "Select * from careers order by Title" ); $ar = array(); while($row = mysql_fetch_object($Result)) { $c = new Career(); $c->buildFromRow($row); $ar[] = $c; } return $ar; } function getCareer($id) { $c = new Career(); $c->buildFromID($id); return $c; } function getTasks($id) { $db = new db(); $Tasks = array(); $Result = $db->query( "Select * from careers_tasks where id = '$id'" ); while($row = mysql_fetch_object($Result)) { $Tasks[] = $row->Task; } return $Tasks; } function getRange($var) { $db = new db(); $rtn = array(); $sql = ""; switch( $var ) { case "Project2016": $sql = "select max(Proj2006) as max, min(Proj2006) as min from careers_employment"; break; case "OpenPerYear": $sql = "select max(Total) as max, min(Total) as min from careers_employment"; break; case "Entry": $sql = "select max(EntryAnnual*1000) as max, min(EntryAnnual*1000) as min from careers_wages"; break; case "PaAvg": $sql = "select max(AvgAnnual*1000) as max, min(AvgAnnual*1000) as min from careers_wages"; break; case "UsAvg": $sql = "select max(AnnualAvg) as max, min(AnnualAvg) as min from careers_wages_us"; break; case "TrainingLevel": $sql = "select DISTINCT (EdLevel) from careers_edulevel"; break; } if($sql == "") return; $Result = $db->query($sql); if( $var == "TrainingLevel" ) { while($row = mysql_fetch_object($Result)) { if( $row->EdLevel != "") $rtn[] = $row->EdLevel; } } else { if($row = mysql_fetch_object($Result)) { $rtn[] = $row->min; $rtn[] = $row->max; } } return $rtn; } } $c = new test_career(); print_r($c->getTasks("11-1011.00")); ?>