private function update() { $q = 'update '; $q .= $this->table_name; $q .= ' set '; $keyvalues = array(); foreach ($this->fields as $field) { $keyvalues[] = $field . "='" . addslashes($this->{$this->getMinName($field)}) . "'"; } $q .= implode(', ', $keyvalues); $q .= ' where ' . $this->table_name . '_id=' . $this->item_id; querySimple($q); }
<?php require_once '../config.php'; querySimple(' truncate table partie; truncate table slot; delete from joueur where joueur_invite=1; ');
public function quitter() { Env::requiert('joueur'); Env::requiert('partie'); Env::requiert('slot'); if ($this->etat != PARTIE::PREPARATION) { throw new Exception('Trop tard pour quitter la partie. (code etat partie : ' . $this->etat . ')'); } foreach ($this->slots as $slot) { querySimple(' delete from slot where slot_id=' . slot()->getID); } $this->updateSlots(); }