Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error_reporting(E_ALL); ini_set('display_errors', 1); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "ahmed";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $code=$_POST['code'];
- $type= $_POST['type'];
- $designation=$_POST['designation'];
- $qte_stock=$_POST['qte_stock'];
- $qte_depart=$_POST['qte_depart'];
- $famille=$_POST['famille'];
- $sql = "INSERT INTO produits(code,type,designation,qte_stock,qte_depart,famille)
- VALUES ($code,$type,$designation,$qte_stock,$qte_depart,$famille)";
- if ($conn->query($sql) === TRUE) {
- echo "New record created successfully";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement