这是代码。出现的错误是“'字段列表'中的未知列 $idUsager”。但是那个专栏是真实存在的。
php代码:
$idUsager = $_POST['idUsager'];
$secMoment = $_POST['secMoment'];
$aire = $_POST['aire'];
$longueur = $_POST['longueur'];
$idMateriau = $_POST['idMateriau'];
//I connect to db and everything works properly here. Also, all variables contain numeric values only. No strings.
$query='INSERT INTO lesPoutres(idPoutre,idUsager,secMoment,aire,longueur,idMateriau)
VALUES(null,$idUsager,$secMoment,$aire,$longueur,$idMateriau)';
$result=mysql_query($query, $lien_bd);
if (!$result) {
print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error());
exit();
}
这是mysql表:
+------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+----------------+
| idPoutre | int(10) unsigned | NO | PRI | NULL | auto_increment |
| idUsager | int(10) unsigned | NO | | NULL | |
| secMoment | float unsigned | NO | | NULL | |
| aire | float unsigned | NO | | NULL | |
| longueur | float unsigned | NO | | NULL | |
| idMateriau | int(5) unsigned | NO | | NULL | |
+------------+------------------+------+-----+---------+----------------+