Zend Db Güncelleme Çalışmıyor

1 Cevap php

Benim tablo yapısı:

TABLE `licenses` (
`id` int(11) NOT NULL auto_increment,
`code` varchar(30) collate utf8_unicode_ci NOT NULL,
`title` varchar(255) collate utf8_unicode_ci NOT NULL,
`description` text collate utf8_unicode_ci NOT NULL,
`license_type` char(1) collate utf8_unicode_ci NOT NULL default 'b',
PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

Şu anda veri var:

(`id`, `code`, `title`, `description`, `license_type`)
(2, 'asd', 'asdt', 'asdd', 'b')

Benim veritabanı nesne iyi ve çalışma olduğunu: $ db [Sınıf: Zend_Db_Adapter_Pdo_Mysql]

Ben güncelleme için bu kullanıyorum:

$data=array( 'id' => 2 , 'code' => 'asd' ,  'title' => 'asdt' , 'description' => 'asdd' , 'license_type' => 'b');

$db->update('licenses' , $data  , $db->quoteInto(" id = ? " , $data['id']));

Onun = 0 bir Rowcount dönen; Ve hiçbir şey veritabanında güncellenmektedir.

Benim veritabanı Mysql. Oluyor ne Herkes, herhangi bir fikri vardır.

1 Cevap

Yani, şey, sql idam olsa bile $ db-> update (....) '0 'döndürür olduğunu, ancak bağlama parametresi (yukarıda $ veri) olarak sağlanan veri tablosunda bulunan orijinal veri sql verilerini değiştirme değilken. Yani bizim kod dönen satır sayısı güvenemez.