Add data into database in php mysql

Adding data into database


<?php
session_start();
include('includes/config.php');
error_reporting(1);
if(strlen($_SESSION['login'])==0)
  { 
header('location:index.php');
}
else{

if(isset($_POST['submit']))
{
$category=$_POST['category'];
$description=$_POST['description'];
$status=1;
$query=mysqli_query($con,"Insert into tblcategory(CategoryName,Description,Is_Active)values('$category','$description','$status')");     
if($query)
{
$msg="Category created";
}
else{
$error="Something went wrong. Please try again.";    
}


?>












Comments

Popular posts from this blog

Create table in mysql database in phpmyadmin panel

Flutter Scratch Card