Is it possible to have this function:
function getProjectData($uid, $what) {
$sql = "SELECT ? FROM projects WHERE fid = ?";
$stmt = $this->db->prepare($sql);
$stmt->execute(array($uid,$what);
return $stmt->fetch(PDO::FETCH_LAZY);
}
"uid" is the user id and "what" would be the column I want e.g. "title" so the query would be:
SELECT title FROM projects WHERE fid = 1
Is this possible?