i have tried this but it is not working
i want to exclude search that the name field is empty
$query = "SELECT * FROM blogpost WHERE title LIKE \"%$trimmed%\" OR post LIKE \"%$trimmed%\" AND disable ='1' AND name IS NOT NULL";
how to check exclude empty mysql field
Moderator: General Moderators
Re: how to check exclude empty mysql field
Code: Select all
$query = "SELECT * FROM blogpost WHERE (title LIKE \"%$trimmed%\" OR post LIKE \"%$trimmed%\") AND disable ='1' AND name IS NOT NULL";Re: how to check exclude empty mysql field
thanks but it did not work it is still showing all rows that have empty name field
Re: how to check exclude empty mysql field
Then maybe they do not have a NULLvalue, but just an empty string? And empty strings are not considered as NULL-s.