【发布时间】:2017-10-07 10:38:00
【问题描述】:
当我想从 PHP 表单向我的库中插入一些数据时,我遇到了问题。 这是我的代码:
<?php
$ref=$_POST['ref'];
$desig=$_POST['desig'];
$ht=$_POST['ht'];
$ttc=$_POST['ttc'];
$prixfttc=$_POST['prixfttc'];
$qte=$_POST['qte'];
$rabais=$_POST['rabais'];
$caract=$_POST['caract'];
$img=$_POST['img'];
$connexion=mysqli_connect("localhost","root","","artimaroc");
$query="INSERT INTO artimaroc.produits (`REF`,`DESIGNATION`,`HT`,`TTC`,`pfttc`,`qte`,`rabais`,`caracteristique`,`image`)
VALUES ('$ref','$desig','$ht','$ttc','$prixfttc','$qte','$rabais','$caract','$img')";
$rep=mysqli_query($connexion,$query);
if($rep==true) echo "done";
?>
here is a picture of the attributes of my table where I want to insert
【问题讨论】:
-
您的代码应该在帖子中,而不是屏幕截图
-
问题在于您的查询,请更正。插入表 (
) 值 ( ) -
请在您的问题中提供一些代码!
-
您为什么只发布您的数据库架构的图片?
-
插入语法不适用于
SET