$pdo = new PDO('mysql:host=localhost;dbname=shop', 'root', '', $opt);
$num = '1';
$fields = 'title';
$stm = $pdo->prepare('SELECT ? FROM products WHERE id=?');
$stm->bindValue(1, $fields, PDO::PARAM_STR);
$stm->bindValue(2, $num, PDO::PARAM_INT);
$stm->execute();
$data = $stm->fetchAll();
var_dump($data);
array (size=1)
0 =>
array (size=1)
'title' => string 'title' (length=5)