-1
I’m trying to create a update
query, in order to define the column name to be updated dynamically, but for some reason I cannot do this.
Why? And how can I do that?
My current code:
//atualizando ideal
public function inserirIdeal() {
$teste = $this->coluna->__get('coluna');
$query = 'update tb_lista set ? = ? where item = ?';
$stmt = $this->conexao->prepare($query);
$stmt->bindValue(1, $this->coluna->__get('coluna'));
$stmt->bindValue(2, $this->ideal->__get('ideal'));
$stmt->bindValue(3, $this->item->__get('item'));
return $stmt->execute();
}