Email search without domain

Asked

Viewed 46 times

0

I’m doing a query to receive various data from BD, which includes entering the email field, but I don’t want to when doing searches to be shown emails because of the domain.

For example, I have an email "[email protected]"

With the following query:

SELECT bb.email FROM bd_email bb WHERE bb.email like '%text_in_search%'

In the field you will receive from $_GET [PHP], I can search for:

- "@abcde"
- "@abcde."
- "cde"
- "e.c"
- ".com"

Logically I want to remove this type of results in the query to not show data improperly.

  • But if you search the entire email, then yes, it returns a result.

You know how I can form this query?

  • Uai, it wouldn’t be .... WHERE bb.email = '[email protected]'

  • Leo Caracciolo: No, I intend to search everything behind the @return data, for example only "uert".

  • I tended but did not tend to ask

  • I think I’ve already done it. What I want is to not return the same data after the arroba (@) in the search. If searching "gmail.com" or "Hotmail.com" will return thousands of results, and that’s something I don’t want. For now, my solution goes through this: ;SELECT bb.email FROM bd_email bb WHERE bb.email like '%text_in_search%' AND SUBSTRING(bb.email, LOCATE('@', bb.email)) not like '%text_to_search%';

  • Yeah, neither your question nor your comments made much sense. There’s an example of how your database is, what the value of text_in_search and what should be the result?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.