Reputation: 10913
Is it possible not to update mysql data if one of the textbox in an html form which will update the mysql data is empty?
Upvotes: 0
Views: 487
Reputation: 6106
if (!empty($_POST['nameOfTheTextBox'])) {
// do sql update query
} else {
echo "you need to enter a text";
}
Also as the comment to your question proposes I would strongly recommend to read about form validation/sanitizing
Upvotes: 1