RE: Find invalid email formats using MySQL query.

2006-05-20 Thread Chris Sansom
At 22:10 +0100 20/5/06, Keith Roberts wrote: Probably the most efficient place to do this sort of field checking would be using javascript in the browser. That would stop the bad addresses even being sent down the line to the server in the first place. Sure, but if you're being conscientious ab

RE: Find invalid email formats using MySQL query.

2006-05-20 Thread Keith Roberts
, 20 May 2006, fbsd wrote: > To: Yesmin Patwary <[EMAIL PROTECTED]>, mysql@lists.mysql.com > From: fbsd <[EMAIL PROTECTED]> > Subject: RE: Find invalid email formats using MySQL query. > > You need to use a stronger edit to check email addresses. > This is what I us

RE: Find invalid email formats using MySQL query.

2006-05-20 Thread fbsd
You need to use a stronger edit to check email addresses. This is what I use. Note the dns mx domain name check. $len = "0,45"; if (empty ($email)) { $errors[] = "You didn't enter a Email Address."; } elseif (!ereg("^([[:alnum:]\.\_\-]+)([EMAIL PROTECTED]:alnum:]\.\-]+\.+)", $email))

Re: Find invalid email formats using MySQL query.

2006-05-20 Thread Peter Brawley
Yesmin Patwary wrote: Dear All, My contact table has email field which contains many invalid email addresses. I find them using following php function. Is there a way to do that check in MySQL query? function emailValidate ($str) { $reg = "^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+

Re: Find invalid email formats using MySQL query.

2006-05-20 Thread Keith Roberts
Well, mysql has support for regex matching. The thing is though, why store invalid email addresses in you database? I think what you are doing is the right approach. Check the email address validity first in php BEFORE saving it to the database. At least you then know you are only storing vali