I am trying to update a record using DBAL Query builder and does not seem to work. The column dataI'm trying to set will only work if I replace the example value testthat I have here with a number.
In this case, it will perfectly update my record.
Even if I use setParameterfor it, it will fail.
$queryBuilder = $this->connection
->update($this->table)
->where('id = ?')
->set('data', 'test')
->setParameter(0, $sessionId);
Am I using this incorrectly or is something else happening?
Edit:
The insert statement works just fine:
$queryBuilder = $this->connection
->insert($this->table)
->values([
'id' => '?',
'secure' => '?',
'modified' => '?',
'lifetime' => '?',
'user_hash' => '?',
'data' => '?',
])
->setParameter(0, $sessionId)
->setParameter(1, 'y')
->setParameter(2, time())
->setParameter(3, $this->minutes)
->setParameter(4, 'test')
->setParameter(5, $data);
}
source
share