<?php
include('include/session.php');
error_reporting(E_ALL);
ini_set('display_errors', 1);
include_once('connection.php');
$dbConnection = new DbConnection();
$connection = $dbConnection->connection;

if(isset($_POST ["submit"])){
$category = $_POST['category'];
$product = $_POST['product'];


$query = "INSERT INTO product (category,product) values ('$category','$product')";
$query_run = mysqli_query($connection,$query);

if($query_run){
    echo "<script> alert('Added Successfully'); window.location.href = '_add_stock.php'; </script>";

} else {
    echo "<script> alert('Something went wrong');window.location.reload(); </script>";
}


}


?>