Code : Tout sélectionner
if($type1 == 'engin')
{
mysqli_query("INSERT INTO flotte VALUES('','$findsect','$emat','$type1','$nom','$caracteristique','$imma','$etat','$position','$causeindispo','$entreeNTI','$sortieprevueNTI','$datenextvisite','$potentiel','$echeance','$prochaineIM','$aptitudeIM','$nom_mission')"); //18 variables au total :NE FONCTIONNE PAS
mysqli_query("INSERT INTO engin VALUES ('','','$findsect','$imma','$heuresm',NOW())"); //FONCTIONNE
}
else
...
La deuxième requête INSERT fonctionne très bien...
après avoir tenté toutes les syntaxes imaginables, j'en conclu que le problème est dans la base... les deux tables sont différentes... mais je ne comprends pas l'erreur...
Voici le code sql de ma table flotte :
Code : Tout sélectionner
CREATE TABLE IF NOT EXISTS `flotte` (
`idmac` int(10) unsigned NOT NULL AUTO_INCREMENT,
`section` varchar(10) NOT NULL,
`codeemat` int(10) NOT NULL,
`type1` char(20) NOT NULL,
`nom` char(15) NOT NULL,
`caracteristique` char(10) DEFAULT NULL,
`imma` char(10) NOT NULL,
`etat` char(15) NOT NULL,
`position` char(15) NOT NULL,
`causeindispo` char(15) DEFAULT NULL,
`entreeNTI` date DEFAULT NULL,
`sortieprevueNTI` date DEFAULT NULL,
`nextvisitetps` date DEFAULT NULL,
`potentiel` float(9,0) DEFAULT NULL,
`echeance` float(9,0) DEFAULT NULL,
`prochaineIM` date DEFAULT NULL,
`aptitudeIM` date NOT NULL,
`nom_mission` varchar(20) DEFAULT NULL,
PRIMARY KEY (`idmac`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;Code : Tout sélectionner
CREATE TABLE IF NOT EXISTS `engin` (
`ideng` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idmac` int(10) unsigned NOT NULL,
`section` varchar(10) NOT NULL,
`imma` varchar(20) DEFAULT NULL,
`heures` float(8,0) DEFAULT NULL,
`datemodif` datetime DEFAULT NULL,
PRIMARY KEY (`ideng`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;