我在mysql中有几个月的表。当我将以下代码用于数据库中不存在的表名时,我想将自定义消息显示为“Invalid Month”。但除了此消息之外,我还收到警告
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 根据用户输入动态生成表名
$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";
}
我怎样才能避免该警告信息?