MySQL Validate Email Records

I know you can use PHP Email Validate filters to check if the data is abc @ abc . ext

Is there anyway I can run a MySQL query to do this, check for only that style format. Otherwise I will have to make a pagination and load balanced limit script to select all records from the DB (50,000+) and the server is already slow for my client on shared hosting.

I just want to see a list of only valid emails and also can I check for duplicates or similarities with like query?

Appreciate any collab on this.

Answers


Somethis like this

SELECT * FROM users WHERE email NOT REGEXP '^[^@]+@[^@]+\.[^@]{2,}$';

OR

SELECT * FROM users WHERE email NOT REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$';

Update. It's just an example,how to use regular expression in Mysql.


Need Your Help

Converting Crystal Reports to SSRS Issue

reporting-services crystal-reports ssrs-2008 crystal-reports-2008 crystal-reports-xi

Hi I am converting the crystal report to the SSRS reporting but i am new to both the reporting tools in crystal report there is lots of fields that are calculate but i am stuck at this one field is

Passing Javascript Variable in Form

javascript html forms

I am new to javascript and i am having a hard time resolving one problem in my script.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.