//定义可以在前面定义gradeList空数组就可以了 //例如 $gradeList=[];
This will not prompt the error of undefined variables
You can define the gradeList variable in front
$gradeList=null It should be because there is no data in your table $grade has no data and no foreach loop is performed
This will not prompt the error of undefined variables
You can define the gradeList variable in front
$gradeList=null It should be because there is no data in your table $grade has no data and no foreach loop is performed