Answer the question
In order to leave comments, you need to log in
How to update records in a database with arbitrary information in Zend Framework 2?
How to edit records (multiple) in a database in a model in ZF2? Tried through
use Zend\Db\TableGateway\AbstractTableGateway;
use Zend\Db\Adapter\Adapter;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\Sql\Select;
use Zend\Db\Sql\Update;
...
$this->update(
array('param' => '1'), // редактируемый столбец
array('parent_id' => $parent_id) // условие
);
nothing happens and it's weird. $update = $this->update(
array('value' => '1'),
array('parent_id' => $parent_id)
);
$this->updateWith($update);
$update = new Update();
$update->table($this->table);
$update->where(array('parent_id' => $parent_id));
$update->set(array('value' => '1'));
$this->updateWith($update);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question