db->tblAdminSavedSearch . '` ' . ' WHERE `id_admin` = ' . $this->db->quote($data['id_admin'], 'integer') . ' AND `id` = ' . $this->db->quote($data['id'], 'integer'); $res = $this->db->queryRow($sql); Qs_Db::isError($res); return null === $res ? false : $res; } function addSavedSearch($data) { require_once('class/DB/DBTable.php'); $table = new DBTable('AdminSavedSearch'); return $table->insert($data); } function deleteSavedSearch($data) { require_once('class/DB/DBTable.php'); $table = new DBTable('AdminSavedSearch'); return $table->delete('`id` = ' . $this->db->quote($data['id'], 'integer') . ' AND `id_admin` = ' . $this->db->quote($data['id_admin'], 'integer')); } function getSavedSearch4Select($adminId) { $sql = 'SELECT `id`, `name` ' . ' FROM `' . $this->db->tblAdminSavedSearch . '` ' . ' WHERE `id_admin` = ' . $this->db->quote($adminId, 'integer') . ' ORDER BY `name` ASC, `added` DESC'; $res = $this->db->queryAll($sql, null, MDB2_FETCHMODE_ASSOC, true, false, false); Qs_Db::isError($res); return null === $res ? false : $res; } function isUniqueName($adminId, $savedName) { $sql = " SELECT 1 FROM `{$this->db->tblAdminSavedSearch}` WHERE `id_admin` = " . $this->db->quote($adminId, 'integer'). " AND `name` = " . $this->db->quote($savedName) . " LIMIT 1 "; $res = $this->db->queryOne($sql); Qs_Db::isError($res); return null == $res ? true : false; } }