It’s need to show a message after submit data into MySQl table. I will show you how to show success message or error message after submit form data in to database using php programming language. I will help you with an example, so follow the example:
<?php $sql=mysqli_query($con,"INSERT INTO `table name`(`field 1`,`field 2`)VALUES('$variable1','$variable2')"); if($sql){ echo "Data submit Successful"; }else{ echo "Data Submit Error"; } ?>
You can store success or error message in a session variable for display in the redirect page. The example code is
<?php $sql=mysqli_query($con,"INSERT INTO `table name`(`field 1`,`field 2`)VALUES('$variable1','$variable2')"); if($sql){ $_SESSION["success"]="Insert Successfully"; }else{ $_SESSION["error"]="Insert Error!!"; } ?>
Question and answer is powered by AnsPress.io