All pastes #742988 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-19 23:50 UTC
rendered paste body
Table definition:

CREATE TABLE  `tblWatch` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `idThread` int(10) unsigned NOT NULL,
  `idUser` int(10) unsigned NOT NULL,
  `dateCreate` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `bActive` int(1) NOT NULL default '1',
  PRIMARY KEY  (`id`),
  KEY `thread_idx` (`idThread`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

Code:

$tblWatch = new TblWatch();  // (this is an extension of Zend_Db_Table_Abstract

$dataWatch = array('idThread' => $rowThread->id, 'idUser' => $memUser->id);

$rowWatch = $tblWatch->createRow($dataWatch);
$rowWatch->save();