Inserting data into mysqli database with bootstrap

i want to insert some form data into database. I am using php/bootstrap/mysqli. i am not good at bootstrap.i have tried several method but its not working. there is no error also , hence i don’t understand what am i doing would be very appreciative if anyone could help me.

here is my form

Items Table


Add Item

Item Code
Unit Id
Unit Price
Category Category 1 option 2
Close Save

here is my connection


mysqli_query($con,"insert into item (code,unit,name,price,cate)      


$link = mysqli_connect("localhost", "root", "", "sof");

// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
	$code =  rand(10000,100000);
  $unit = $_POST['unit'];
  $name = $_POST['name'];
  $price = $_POST['price'];
  $cate = $_POST['cate'];
  $sql = "INSERT INTO `items` (`code`, `unit`, `name`, `price`, `cate`) VALUES ('$code', '$unit', '$name', '$price', '$cate')";
  if (mysqli_query($link, $sql)) {
  echo "success";
  } else {
    echo "error";
  echo '<form method="post" action="a.php">  
  unit: <input type="text" name="unit">
    name: <input type="text" name="name">
    price: <input type="text" name="price">
    cate: <input type="text" name="cate">
    <input type="submit" name="txtbutton" value="Submit">