Project / Support Center
Welcome, Guest. Please login or register. July 12, 2020, 10:49: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL/PHP  |  Topic: Don't show a record that contain some string or word. 0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: Don't show a record that contain some string or word.  (Read 1717 times)
admin
Administrator
******
Offline Offline

Posts: 193


« 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
« Last Edit: November 19, 2019, 03:19: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  MySQL/PHP  |  Topic: Don't show a record that contain some string or word. « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!