0

I am creating a table where I want to show the data where one column is empty.

I tried everything but nothing seems to work

$sql = "SELECT * from tblleaves where empid=:eid and EndKm is NULL order by PostingDate desc";

In other words, I want to fetch data where endkm column is empty or has spaces only.

If I remove EndKm is NULL everything works fine for me.

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119

1 Answers1

0

Try SELECT * from tblleaves where empid=:eid and (EndKm IS NULL or TRIM(EndKm) = '') order by PostingDate desc

Marcaum54
  • 623
  • 1
  • 6
  • 12