Data is not Submitted to DB

<?php 
                                if(isset($_POST['submit']))
                                {
                                    $cato_title = $_POST['cat_name'];
                                    if($cato_title == "" || empty($cato_title))
                                    {
                                        echo "This field can not be empty.";
                                    }
                                    else
                                    {
                                        $insert = "INSERT INTO categories (cat-title) VALUES ('$cato_title')";
                                        $create_category_query = mysqli_query($con, $insert);
                                        if(!$create_category_query)
                                        {
                                            echo "Data not Submitted";
                                        }
                                        else
                                        {
                                            echo "Category added";
                                        }
                                    }
                                }

                                ?>

is the query within the condition being used?

@chorn Thanks for your response. I found the issue. Actually the naming of table in DB was the issue.

Thanks a lot

Sponsor our Newsletter | Privacy Policy | Terms of Service