MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old March 4th, 2000, 04:54 PM
Decius Decius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 44 Decius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Hi, I have a table of user inputed e-mails and a lot of them haven't put correct e-mails in. When I use the
mail(email, blah, blah); command and loop through all of them, it stops on some of them giving me errors.

How would I either:
1. Bypass it so that it doesn't stop on false e-mails
2. Clean up the table and remove e-mails that will stop it.

When i try to run the command "select email from users where email = '%@%';" I get an empty set, even though there are over 500 e-mails in there.

Can someone tell me what an e-mail address requires to be processed correctly? Also, why isn't the wildcard working? Is my syntax correct?

Thanks.

Decius

Undergrounds.com - Free Model and Actress Picture Resource http://www.undergrounds.com/
-----------------------------------------
Over 6000 pictures for over 150 beautiful
women. Including actresses, models, and
singers, our oceanic galleries are all
alphabetically filled with high quality
images.

Reply With Quote
  #2  
Old March 4th, 2000, 07:33 PM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 13
Send a message via AIM to rod k
You must use LIKE not = when using wildcards. Also, I'd recommend using this pattern "%@%.%"

That should stop mail() from complaining, even if the address isn't valid.

Reply With Quote
  #3  
Old March 5th, 2000, 11:40 AM
Kyuzo Kyuzo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Annapolis, Maryland US
Posts: 113 Kyuzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Here's a select that gets all valid (syntactically) email addresses from your table. Whether or not they actually exist, that's another matter....

select * from table
where email regexp '([_.0-9a-z-]+@)([0-9a-z][0-9a-z-]+.)+([a-z]{2,3})';


Reply With Quote
  #4  
Old March 5th, 2000, 03:39 PM
Decius Decius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 44 Decius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Thanks. :-)

Works like a charm. One question Kyuzo...
Your select statement allows email addresses such as blah@blah to be passed, without a .com etc.

Is this your intention? Or should I configure it so that it checks for a .com too?

Thanks.

Reply With Quote
  #5  
Old March 6th, 2000, 08:14 AM
Kyuzo Kyuzo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Annapolis, Maryland US
Posts: 113 Kyuzo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Decius,

Are you sure about that??? I changed an email in one of my tables to blah@blah ;-) and the select statement didn't pull it out. The final part of the regular expression ( the .)+([a-z]{2,3})'; stuff...) should check for a .com, .org, .net, .jp, .de, dot just about anything. Give it a shot again and let me know if it doesn't work -- I'll be surprised if it doesn't....

Regards,

Kyuzo

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > E-mail clean ups - Wildcards and more


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway