/** * @param string $apikey * @return bool */ public function destroyKey($apikey) { $this->db->setQuery('UPDATE user SET apikey="" WHERE username="******";'); $this->db->query(); if ($this->db->getSqlstate() === '00000') { return true; } else { return false; } }
/** * @param string $tableName * @param integer $recordId * * @return bool */ public function delete($tableName, $recordId) { $this->db->setQuery('DELETE FROM ' . $tableName . ' WHERE id=' . $this->sanitize($recordId) . ';'); $this->db->query(); // If the query was successful, return true if ($this->db->getSqlstate() === '00000') { return true; } else { return false; } }