Hi, as you know i'm creating my own CMS.
This is a part of my code:
if (!empty($_POST["Title"]) && !empty($_POST["Author"]) && !empty($_POST["Content"])) {
$sql = "INSERT INTO Posts (Title, Author, Content)
VALUES ('$title', '$author', '$content')";
}
I want the script to check if Title Field and Author field and Content field are empty, stop sending blank rows into table. Because when i click the submit button while all these fields are empty and then check the table, i see blank rows added into table.
Now with the code above, no blank rows will be added to table but when i click the submit button while all those fields are empty, this error will be appeared on the top of the page suddenly!General error: trying to execute an empty query
Well, how can i remove that error from the top of the page?!