/** * Replacement for mysql_affected_rows * Returns count. Optionally closes the recordset * * @param recordset $rst * @param boolean $close * @return int */ function umc_mysql_affected_rows($rst, $close = false) { $rowCount = $rst->fetchColumn(); if ($close) { $rst->closeCursor(); } return $rowCount; }
private function addRule($content) { $strReq = 'SELECT rule_id FROM ' . $this->table . ' ' . "WHERE rule_type = 'word' " . "AND rule_content = '" . $this->db->escapeStr($content) . "' "; if (($rs = $this->db->select($strReq)) === false) { $rs = new recordset(array()); } if (!$rs->isEmpty()) { throw new Exception(__('m_antispam_This_word_exists')); } $rs = $this->db->select('SELECT MAX(rule_id) FROM ' . $this->table); $id = (int) $rs->f(0) + 1; $cur = $this->db->openCursor($this->table); $cur->rule_id = $id; $cur->rule_type = 'word'; $cur->rule_content = (string) $content; $cur->insert(); }
$load_group = $recordset->result($result, "Load_Group"); $table = $recordset->result($result, "Code_Table"); $notes = $recordset->result($result, "Notes"); $description = $recordset->result($result, "Description"); $table_name = $recordset->result($result, "Table_Name"); $table_type = $recordset->result($result, "Table_Type"); $table_desc = $recordset->result($result, "Table_Desc"); $info["pack"] = $pack; $info["load_group"] = $load_group; $info["table"] = $table; $info["notes"] = $notes; $info["description"] = $description; $info["table_name"] = $table_name; $info["table_type"] = $table_type; $info["table_desc"] = $table_desc; $rs = new recordset(); //Si hay jerarquia buscamos con que tabla se relaciona if ($load_group) { $sql = "SELECT * FROM tables_hierarchy_dependency WHERE Code_Table='" . $table . "' AND status_mobile<>'99'"; $res = $rs->query($conex, $sql); if ($rs->fetch_row($res)) { $field = result_list($conex, "tables_fields", "Code", $rs->result($res, "Code_Field"), "Name"); $field_link = result_list($conex, "tables_fields", "Code", $rs->result($res, "Code_Field_Link"), "Name"); $table_link = result_list($conex, "tables", "Code", $rs->result($res, "Code_Table_Link"), "Table_Name"); $info["jerarquia"] = array(); $info["jerarquia"]["Table"] = $table; $info["jerarquia"]["Field"] = $rs->result($res, "Code_Field"); $info["jerarquia"]["Table_link"] = $rs->result($res, "Code_Table_Link"); $info["jerarquia"]["Field_link"] = $rs->result($res, "Code_Field_Link"); $info["jerarquia"]["Field_name"] = $field; $info["jerarquia"]["Field_link_name"] = $field_link;