Web Global Net Web Application & Web Development Project Center

Technical Issues => MySQL/PHP => Topic started by: admin on November 19, 2019, 03:15: PM

Title: Don't show a record that contain some string or word.
Post by: admin on November 19, 2019, 03:15: PM
This I had a tough time doing and although I am sure there is a more "Correct" way to do this this is what finally worked for me after trying NOT CONTAIN, NOT LIKE and others in the where clause.

I had customers enter a fake email for certain people in their list, the email always contained person@noemail.com at the end

To eliminate those records from receiving emails I included in the mysql query the following:

WHERE RIGHT(group.contact_email,11)!='noemail.com'

The green is the table.field and the 11 is the number of characters in the noemail.com string itself.. By adding RIGHT to the expression it is saying count 11 characters from the right side of the field.

!= this means not

So the expression says - count the 11 characters from right side of the field and don't include those in the displaying results