Sunday, October 19, 2008

MySQL - find bad email addresses in database

I needed a quick way to find bad email addresses in my mysql database that was not being verified when the users entered them into the form. That will be the next fix.

A quick select using:

SELECT name,email FROM `D_User` WHERE `email` NOT LIKE '%@%.%'


... and I had all the bad email addresses.

1 comment:

  1. You mean you had *MOST* of the bad addresses.

    "@." would slip past your query, as would "a@b.AReallyLongTLD". Same goes for invalid characters.

    What you really should do is run the query using regular expression commands. Check out this MySQL regex tutorial: www.go4expert.com/forums/showthread.php?t=2337.

    I got your LinkedIn invite and thought I'd check out your blog. Good Stuff! You probably saw on my portfolio that I'm running a Web Development business in Cheney. I'm looking for a Graphic Design intern and an ASP.NET/C# programming intern. If you know of any good candidates, send them over to Career Services to fill out an application for XeroOne Systems.

    - Jason MH Alvarado

    ReplyDelete