Please help me, I can't using bindValue() in PDOStatement.
$statement = self::$dbConn->prepare("SELECT * FROM :tableDB WHERE id = :id");
$statement->bindValue(":id", $id, PDO::PARAM_INT);
$statement->bindValue(":tableDB", $tableDB, PDO::PARAM_STR);
$statement->execute();
$statement->setFetchMode(PDO::FETCH_ASSOC);
$result = $statement->fetchAll();
When i run this script.
$statement = self::$dbConn->prepare("SELECT * FROM :tableDB WHERE id = :id");
$statement->bindValue(":id", $id, PDO::PARAM_INT); // Return true
$statement->bindValue(":tableDB", $tableDB, PDO::PARAM_STR); // Return true
But when run to:
$statement->execute(); // Return false.