当我想从 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";
?>
这是代码
<?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";
?>