php - Zend Framework Database Insert Issue -


i'm starting out using zend framework , have created suitable model saves data database table. issue having sql statement trying insert '?' value each column in database. have created following save function passes array of data dbtable adapter functions:

public function save()     {     $data = $this->getdata();     if ($data['pageid']==0) {         $this->getdbtable()->insert($data);     } else {          $this->getdbtable()->update($data, array('pageid = ?' => $data['pageid']));     } }  

this seems go through appropriate motions item not added database , sql statement within mysql logs looks like:

insert db_table ('pageid','title','body') values ('?', '?', '?'); 

not quite sure falling down, pointers gratefully received.

thanks

data should in next format:

$data = array(    'pageid' => 1,    'title'  => 'title',    'body'   => 'body' ); 

are sure $this->getdbtable() returns db adapter? try use:

$db = new zend_db_table('table_name'); $db->insert($data); 

Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

xslt - Umbraco and EXSLT sets do not work -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -