I created a method for returning a certain row and there is no error or anything just the method not returning any data from the database.
Here is where I invoke the method:
<a class="navbar-brand" href="http://localhost/old marketplace website/">
<?php echo $controller->getTableData($table, $column, $columnValue, $rowTitle); ?>
</a>
And here is what the method getTableData()
looks like:
public function getTableData($table, $column, $columnValue, $rowTitle)
{
$query = $this->db->prepare("SELECT * FROM $table WHERE $column = ? ");
$query->bindValue(1,$columnValue);
$query->execute();
$f = $query->fetch(PDO::FETCH_ASSOC);
$result = $f['$rowTitle'];
return $result;
}
How do I need to adjust my method to have it return the desired data?