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]'
– user60252
Leo Caracciolo: No, I intend to search everything behind the @return data, for example only "uert".
– Tiago165
I tended but did not tend to ask
– user60252
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%';
– Tiago165
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?– Woss