示例#1
0
function update()
{
    if (array_key_exists("id", $_POST)) {
        foreach ($_POST as $index => $valeur) {
            $donnees[$index] = $valeur;
        }
    }
    $data = new data();
    $data->update($donnees);
}
示例#2
0
 public static function update_last_session()
 {
     data::update('logs_usuarios', 'ultima_session = "' . calendar::now() . '"', self::$logid);
 }
示例#3
0
 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;
 }
示例#4
0
 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);
 }