我有一个查询
$sql="SELECT mstEmp.empname,mstEmp.cardno, InDate, dailyattendance.InTime,dailyattendance.OutTime, mstEmp.teamtype FROM mstEmp left JOIN dailyattendance ON (InDate BETWEEN '$from' AND '$to' ) AND (dailyattendance.HolderName = mstEmp.empname ) WHERE mstEmp.teamtype = '$chk' ORDER BY InDate DESC";
现在当我将它作为print_r($ row)运行时,它给出了数组为[0] = absbd [1] = 34 [2] = [3] = [4] = 现在我想[2]这是显示日期的日期,但它给了我垃圾值。
答案 0 :(得分:1)
答案 1 :(得分:0)
您可以明确检查null:
if($row[2] === null) {
// Special behavior for null
] else {
// Handle the date normally
}