0

I'm trying to pull an array from a mysql table and put it into an html table. It works successfully but when I try and add the restriction != null, no data is returned.

$query = mysqli_query($link, "select * from timetable Where id = $id and Subject != NULL");
Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

3

Don't use equality operator with NULL. You should use IS NULL or IS NOT NULL
Example:

Subject IS NOT NULL
RMT
  • 7,040
  • 4
  • 25
  • 37
Rahul
  • 76,197
  • 13
  • 71
  • 125