nielsv nielsv - 4 months ago 28x
PHP Question

TRUNCATE Table + Zend Framework

I do this:

$data = array('coords' => $district->getCoords(),
'id' => $district->getId(),
'fid' => $district->getFid(),
'wijziging'=> $district->getWijziging(),
'nieuwnr' => $district->getNieuwnr(),
'naam' => $district->getNaam(),
'wijk' => $district->getWijk(),
'wijknr' => $district->getWijknr(),
'objectid' => $district->getObjectid(),
'area' => $district->getArea(),
'len' => $district->getLen(),


_dbTable -> references to my table 'Districts'.

Now I want to clear the table first before I insert the data.

How can I do this?


Try to get the adapter if you really need to truncate the table

$this->_dbTable->getAdapter()->query('TRUNCATE TABLE '.$this->_dbTable->info(Zend_Db_Table::NAME));