custom message in php mysql error/warning
I have several months as tables in mysql. When i use the below code for a
table name that doesn't exist in my database i want to display a custom
message as "Invalid Month".But in addition to this message i am getting a
warning as
Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt,
boolean given in C:\xampp\htdocs\student_portal\admin\update_attd.php on
line 102
i Generate the table name dynamically based on the user input
$sql="SELECT * FROM `tablename`";
$stmt = mysqli_prepare($con, $sql);
if(!mysqli_stmt_execute($stmt)){ //this is the line that shows the
warning
echo " invalid month";
}
how can i avoid that warning message?
No comments:
Post a Comment