...

View Full Version : Hi All new on this...need help!!!



mvpari
01-31-2005, 04:32 PM
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 :confused:

raf
02-01-2005, 12:35 AM
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,... ?)

Brandoe85
02-01-2005, 02:22 AM
Aren't you validating this before it's entered into the db?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum