erreur sur le insert TaskGateway.php

list-Gtw-Mdl
Nicolas FRANCO 2 years ago
parent e2009994bd
commit cc0f30d3a2

@ -28,5 +28,4 @@
return $this->stmt->fetchall(); return $this->stmt->fetchall();
} }
} }
?> ?>

@ -1,11 +1,11 @@
<?php <?php
require_once("Connection.php");
include_once("../business/Task.php"); include_once("../business/Task.php");
include_once("..Connection.php");
class TaskGateway class TaskGateway
{ {
// connection attribute // connection attribute
private Connection $con; public Connection $con;
// constructor // constructor
public function __construct(Connection $con){ public function __construct(Connection $con){
@ -16,10 +16,12 @@ include_once("..Connection.php");
// code de retour pour les fonctions i,u,d? // code de retour pour les fonctions i,u,d?
public function insert(Task $t){ public function insert(Task $t){
$query='INSERT INTO Tache VALUES (:id,:titre,:descript,:priorite)'; $query='INSERT INTO Tache VALUES (:id,:titre,:descript,:priorite)';
$this->con->executeQuery($query, array(':id'=> array($t->id,PDO::PARAM_STR),
':titre'=> array($t->titre,PDO::PARAM_STR), $this->con->executeQuery($query, array(
':descript'=> array($t->description,PDO::PARAM_STR), ':id'=> array($t->get_id(),PDO::PARAM_STR),
':priotite'=> array($t->priorite,PDO::PARAM_STR))); ':titre'=> array($t->get_titre(),PDO::PARAM_STR),
':descript'=> array($t->get_description(),PDO::PARAM_STR),
':priotite'=> array($t->get_priorite(),PDO::PARAM_STR) ));
} }
public function update($id_task){ public function update($id_task){
@ -31,7 +33,7 @@ include_once("..Connection.php");
} }
# comment ça marche ? # comment ça marche ?
public function Find(array $elements):array{ public function Find($element, $valeur){
// Find a task by multiple elements // Find a task by multiple elements
// returns the array of found tasks // returns the array of found tasks
} }

Loading…
Cancel
Save