Exemple #1
0
 function delete($oid = null)
 {
     $k = $this->_tbl_key;
     if ($oid) {
         $this->{$k} = intval($oid);
     }
     if (mosDBTable::delete($oid)) {
         $query = "DELETE FROM #__poll_data" . "\n WHERE pollid = " . (int) $this->{$k};
         $this->_db->setQuery($query);
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         $query = "DELETE FROM #__poll_date" . "\n WHERE poll_id = " . (int) $this->{$k};
         $this->_db->setQuery($query);
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         $query = "DELETE from #__poll_menu" . "\n WHERE pollid = " . (int) $this->{$k};
         $this->_db->setQuery($query);
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         return true;
     } else {
         return false;
     }
 }
Exemple #2
0
 function delete($oid = null)
 {
     $k = $this->_tbl_key;
     if ($oid) {
         $this->{$k} = intval($oid);
     }
     if (mosDBTable::delete($oid)) {
         $this->_db->setQuery("DELETE FROM #__poll_data WHERE pollid='" . $this->{$k} . "'");
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         $this->_db->setQuery("DELETE FROM #__poll_date WHERE pollid='" . $this->{$k} . "'");
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         $this->_db->setQuery("DELETE from #__poll_menu where pollid='" . $this->{$k} . "'");
         if (!$this->_db->query()) {
             $this->_error .= $this->_db->getErrorMsg() . "\n";
         }
         return true;
     } else {
         return false;
     }
 }