function update() { if (array_key_exists("id", $_POST)) { foreach ($_POST as $index => $valeur) { $donnees[$index] = $valeur; } } $data = new data(); $data->update($donnees); }
public static function update_last_session() { data::update('logs_usuarios', 'ultima_session = "' . calendar::now() . '"', self::$logid); }
public function update($id, array $fieldsValues) { $this->filter("id = " . data::escapeString($id)); $fields = array(); $values = array(); $this->fieldsValuesArray($fieldsValues, $fields, $values); $return = data::update($this->tableName, $fields, $values, $this->where, $this->order, $this->limit); $this->clearQuery(); return $return; }
public function update($id, array $valuesArray) { $set = ''; foreach ($valuesArray as $k => $v) { if (array_key_exists($k, $this->fields)) { $set .= "`" . mysql_real_escape_string($k) . "` = '" . mysql_real_escape_string($v) . "',\n "; } else { die("<br /><b>ERROR:</b> field <i>\"{$k}\"</i> is not part of <i>\"{$this->name}\"</i><br />"); } } $set = substr($set, 0, -3); return data::update($this->table, $set, $id); }