So i have the following query
query = "SELECT date_format(startPeriod,'%a, %M, %d, %Y') as startDate,
date_format(startTime,'%I:%i%p') as startTime,
date_format(endTime,'%I:%i%p') as endTime,
jobLocation,jobId,
hoursWorked
FROM users,paycheck
WHERE users.userId = '" . $_SESSION['userId'] .
"' AND userId = empId
AND startPeriod IS NOT NULL
ORDER BY paycheck.startPeriod DESC";
The problem is that some of the values of startPeriod( which is a date) are null so when i run my query I dont want to show those dates which are null, but unfortunately dates that are null show up on my table . How can I fix this?
this is my output file on my source
<tr><td></td><td>12:00AM</td><td>12:00AM</td><td>none</td><td>none</td><td>0.00</td></tr>
In between the first tds you can see its empty
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…