erreur INSERT corrigé

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

@ -15,13 +15,13 @@ class TaskGateway
// functions // functions
// 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,NULL,NULL,:priorite)';
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
':id'=> array($t->get_id(),PDO::PARAM_STR), ':id'=> array($t->get_id(),PDO::PARAM_STR),
':titre'=> array($t->get_titre(),PDO::PARAM_STR), ':titre'=> array($t->get_titre(),PDO::PARAM_STR),
':descript'=> array($t->get_description(),PDO::PARAM_STR), ':descript'=> array($t->get_description(),PDO::PARAM_STR),
':priotite'=> array($t->get_priorite(),PDO::PARAM_STR) )); ':priorite'=> array($t->get_priorite(),PDO::PARAM_STR) ));
} }
public function update($id_task){ public function update($id_task){

@ -1,4 +0,0 @@
<?php
static $user = 'nifranco';
static $pass = 'f3wn5ady';
?>

@ -1,3 +0,0 @@
<?php
echo "php test"
?>

@ -1,3 +0,0 @@
<?php
echo "<h1>2do test</h1>";
?>

@ -1,6 +1,12 @@
<?php <?php
require_once("../business/Task.php"); require_once("../business/Task.php");
require_once("../dal/TaskGateway.php");
echo "<h1>2do test</h1>"; echo "<h1>2do test</h1>";
$tache1 = new Task(1,'aTask','myTest','urgent'); $t = new Task(10,'testNico','laDescription','urgent','001');
//include("../dal/Connection.php");
include("credentials.php");
$con = new Connection('mysql:host=localhost;dbname=phpproject',$user,$pass);
$tgt = new TaskGateway($con);
$tgt->insert($t);
?> ?>

Loading…
Cancel
Save