To query in different cells of a given table I want to use one function where I pass the cell´s name to query, like this :
$cell = 'frames';
$query = $this->db->prepare('SELECT :cell FROM time_table WHERE time = :time ');
$query->bindValue(':cell', trim($cell), PDO::PARAM_STR);
$query->bindValue(':time', trim($time), PDO::PARAM_STR);
$success = $query->execute();
$query_result = $query->fetchAll();
print_r($query_result);
But instead of getting the content of the frames
I get the cell' name, which is frames
.
What do I need to do to get the content ?