Hello I'm making an update function and am using the mvc pattern and am getting this error only while trying to execute this funtion the database connection has been effectued succesfully the create function works fine
this is the code in modifiercours.php
<?php
include_once '../config.php';
require '../Model/CoursM.php';
$db=config::getConnexion();
$sql="SELECT * FROM 'cours' where Idc=?";
$query = $db->prepare($sql);
$query->execute([$_GET['Idc']]);
$prod=$query->fetchall();
?>
this is the code in my controllers CoursC.php file
function Modifieev($cours)
{
$sql= "UPDATE `Cours` SET
titre=:titre,matiere=:matiere,datep=:datep,Idc=:Idc,auteur=:auteur WHERE Idc=Idc ";
$db=config::getConnexion();
try{ $recipesStatement = $db->prepare($sql);
$recipesStatement->execute([
'titre'=>$cours->gettitre_Cours(),
'matiere' =>$cours->getmatiere(),
'datep'=>$cours->getdatep(),
'Idc'=>$cours->getIdc(),
'auteur'=>$cours->getauteur(),
//'id'=>$cours->getId_Cours(),
]);
} ''' and this is modifier.php
<?php
include_once '../config.php';
include_once '../Controller/coursC.php';
include_once '../Model/coursM.php';
if(!isset($_POST['titre'])||!isset($_POST['matiere'])||!isset($_POST['datep'])||
!isset($_POST['Idc'])||!isset($_POST['auteur']))
{
echo "erreur de ";
}
$cate=new cours($_POST['titre'],$_POST['matiere'],$_POST['datep'],$_POST['Idc'],$_POST['auteur']);
$cat=new coursC();
$cat->Modifieev($cate);
header('location:http://localhost/web/View/affichercours.php');
?>