Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Hi All new on this...need help!!!

    Hi all,

    A quick question, I'm trying to identify relevant email addresses from a table. So far I've got the following in the where clause:
    where email is not NULL
    and email like ('%@%')

    But does anyone know how I could get rid of spaces (if they occur) in the email field. For example 745856 @usa.net, should actually read as 745856@usa.net....

    thanx

    mvpari

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Welcome here!

    where email is not NULL and email like ('%@%')
    should be
    where email like ('%@%')

    to get rid of the spaces --> depends on the db-format you use. For MySQL, that would be
    SELECT REPLACE(email,' ','') AS email FROM yortablename WHERE email LIKE ('%@%')

    but you could also do hthis in your server side language (PHP, ASP,... ?)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Aren't you validating this before it's entered into the db?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •