Thanks so much everyone who replied! The === sign worked fine! I've spent about 5 days on this one piece of coding so I'm delighted I now know what the problem is! I was under the misconception that the == meant not equal to, even though I had seen coding with the != as well which I know for sure is not equal to, because I do write SQL. This was most definitely my problem with trying to get the data from the database too!!
Thanks so much for your help, it's much appreciated!