I need to use a key from an array for a check.
The array comes from a PDO query like this
function getProject($proj_id) {
$database = new Database();
$database->query( "SELECT * FROM projects WHERE proj_id = '$proj_id' LIMIT 1" );
$project = $database->resultSet();
return $project;
}
Then I print the array which works like it should.
$project = getProject(1);
print_r($project);
Array ( [0] => Array ( [proj_id] => 73 [proj_name] => Cake )
But when I try to print a specific key from the array like this:
print_r($project['proj_name'];
Nothing gets printed on the screen. Why not?