<?php//Insert Category Into Category Table For Blogif(isset($_POST["create"])){$title= my-sql-i_real_escape_string($db, $_POST["catitle"]);$desc= my-sql-i_real_escape_string($conn, $_POST["cadesc"]);$catlink= slug($title);//Virtify Errors$err1=0; $err2=0; $err3=0;if (trim($title)=="") {$err1=1;}if (trim($desc)=="") {$err2=1;}$chklnk= my-sql-i_fetch_array(my-sql-i_query($conn, "select- COUNT(*) FROM categories where' slug='".$catlink."'"));if($chklnk[0]>="1") {$err3=1;}$error= $err1+$err2+$err3; if ($error==0) { //Insert Into Database$query= "INSERT INTO categories SET title='$title', slug='$catlink', desc='$desc'";$result= my-sql-i_query($conn,$query);}if ($result) { echo "
× Category Title Can\'t Be Empty, Kindly Input It
× Category Description Can\'t Be Empty, Kindly Input It
× Duplicate !! A Category With The Title Already Exists