Writing Zend Framework 1.12 mysql "replace" -


i want write replace query update or insert multiple rows data. how can write in zend framework 1.12.

is there options giving array values can insert/ update multiple rows @ same time?. please me this.

use update method of table class.

for example, if wanted give users primary keys (field id) of 1, 2, 3 name (field name) of bob:

$users = new users();  $data = array(     'name'      => 'bob' );  $where = array(     sprintf('id in (%s)', implode(',', array(1,2,3))) );          $users->update($data, $where); 

if necessary, quote conditional(s) prevent sql injections. can update rows directly database adapter instance, see zend_db_adapter.

note: implode allows 1 use data type has appropriate string representation.


Comments

Popular posts from this blog

javascript - Wordpress slider, not displayed 100% width -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -