bonjour,voila je dois realiser un site pour une entreprise mais quand je veux ajouter une question il m'envoie "erreur d'écriture" sa fait plusieur heure que je suis sur cette erreur et je ne trouve pas la solution .
voila les table:
Create table Application (
Id_application Int NOT NULL AUTO_INCREMENT,
nom_application Varchar(150) NOT NULL,
Index AI_Id_application (Id_application),
Primary Key (Id_application)) ENGINE = INNODB DEFAULT CHARSET=latin1 ;
Create table Question (
num_Id_application Int NOT NULL,
Id_Question Int NOT NULL AUTO_INCREMENT,
Num_Question Int,
Question Char(255),
Reponse Char(255),
Picture Char(255),
num_Id_Source Int NOT NULL,
Primary Key (Id_Question)) ENGINE =INNODB DEFAULT CHARSET=latin1 ;
Create table Source (
Id_Source Int NOT NULL AUTO_INCREMENT,
Libelle_Source Char(50),
Primary Key (Id_Source)) ENGINE = INNODB DEFAULT CHARSET=latin1 ;
alter table Question add foreign key (num_Id_application) references Application(Id_application);
alter table Question add foreign key (num_Id_Source) references Source(Id_Source);
commit;
et voila mon code :
<?php
$serveur='localhost';
$utilisateur='root';
$mdp='';
$bdd='faq_dsic';
$num_ques= $_POST['num_question'];
$question= $_POST['question'];
$reponse = $_POST['reponse'];
$application=$_POST['application'];
$source= $_POST['source'];
$reponse1 = $_POST['reponse'}
$MonObjConnexion= new mysqli($serveur,$utilisateur,$mdp,$bdd);
if (mysqli_connect_errno())
{echo "probleme de connexion à la base de données";
exit;}
$MaReq= "insert into Question values(' ',' ' ,'.$num_ques.','.$question.','.$reponse.','.$reponse1.,' ' )";
$ObjResultReq=$MonObjConnexion->query("insert into question values('','','quelle est le probleme','rien du tout','tes sur','','')");
if (! $ObjResultReq)
{ die ("Erreur d'écriture");}
$MonObjConnexion->close();
?>
merci de votre aide