private function init() { // récupération de l'id de l'utilisateur et de sa langue étudiée $this->user = user::getInstance(); $this->userlang = $this->user->langGame; $this->createur = $this->user->id; //récupération de la date au format jour/mois/année/heure $this->et_c_est_le_temps_qui_court = date("d/m/Y H:i"); //récupération des points druides $this->pointsDr = variable::getPointsDruide(); // récupération du formulaire de création de carte $this->submit = isset($_POST['submit_form']); if ($this->submit) { $this->res['mot'] = isset($_POST['mot']) ? trim($_POST['mot']) : ''; $this->res['theme_carte'] = isset($_POST['theme_carte']) ? trim($_POST['theme_carte']) : ''; $this->res['nivcarte'] = isset($_POST['nivcarte']) ? trim($_POST['nivcarte']) : ''; $this->res['tabou1'] = isset($_POST['tabou1']) ? trim($_POST['tabou1']) : ''; $this->res['tabou2'] = isset($_POST['tabou2']) ? trim($_POST['tabou2']) : ''; $this->res['tabou3'] = isset($_POST['tabou3']) ? trim($_POST['tabou3']) : ''; $this->res['tabou4'] = isset($_POST['tabou4']) ? trim($_POST['tabou4']) : ''; $this->res['tabou5'] = isset($_POST['tabou5']) ? trim($_POST['tabou5']) : ''; $this->res['tabou6'] = isset($_POST['tabou6']) ? trim($_POST['tabou6']) : ''; } $db = db::getInstance(); $sql = 'SELECT * FROM carte '; $result = $db->query($sql); //$reponse = $result->fetch_array(); //$row = $result->fetch_assoc(); // $result->free(); $this->theme_carte = ''; for ($i = 0; $i < $result->num_rows; $i++) { $row = $result->fetch_assoc(); $this->theme_carte .= $row['theme'] . ';'; } return true; //$this->theme_carte = $row['theme']; }