1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <?php
$code_mat_pre=$_POST["code_mat_pre"];
$qte_mat_pre=$_POST["qte_mat_pre"];
$typ_mat_pre=$_POST["typ_mat_pre"];
$hostname = "localhost";
$database ="art-mania";
$username = "root";
$passwords ="";
$connect = mysql_connect($hostname, $username, $passwords) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $connect);
$requete="INSERT INTO matiere_premiere (typ_mat_pre,code_mat_pre) VALUES ('".$_POST['typ_mat_pre']."','".$_POST['code_mat_pre']."')";
$result = mysql_query($requete, $connect) or die(mysql_error());
$requete= "INSERT INTO necessiter (qte_mat_pre) VALUES ('".$_POST['qte_mat_pre']."')";
$result = mysql_query($requete, $connect) or die(mysql_error());
if(!$result){
echo("erreur");
}
mysql_close();
?> |
Partager