PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Re: Need with email-match query
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Need with email-match query

Réponse
 
LinkBack Outils de la discussion
Vieux 11/09/2007, 23h06   #1
axlq
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with email-match query

In article <46e64fd4$0$31120$6e1ede2f@read.cnntp.org>,
gosha bine <stereofrog@gmail.com> wrote:
>
>you can use mysql regular expressions, e.g.
>
>select * from users where email rlike 'user([+][^@]+)?@example[.]com'


Cool. That's just what I wanted to know. I feared the answer would
involve something inefficient like reading in the entire column and
processing it in php.

>or, if you need this query often create an extra "canonical email"
>column in the database.


I was thinking of that solution too, but adding a redundant column,
didn't seem as elegant as constructing a query to work with what I
have.

-A
  Réponse avec citation
Vieux 12/09/2007, 04h33   #2
Steve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need with email-match query


"axlq" <axlq@spamcop.net> wrote in message
news:fc73hv$q2c$3@blue.rahul.net...
> In article <46e64fd4$0$31120$6e1ede2f@read.cnntp.org>,
> gosha bine <stereofrog@gmail.com> wrote:
>>
>>you can use mysql regular expressions, e.g.
>>
>>select * from users where email rlike 'user([+][^@]+)?@example[.]com'

>
> Cool. That's just what I wanted to know. I feared the answer would
> involve something inefficient like reading in the entire column and
> processing it in php.
>
>>or, if you need this query often create an extra "canonical email"
>>column in the database.

>
> I was thinking of that solution too, but adding a redundant column,
> didn't seem as elegant as constructing a query to work with what I
> have.


i think what he's suggesting is not a redundant column. rather, a normalized
structure. one where an "email address" column contained only email
addresses (minus any other magic data you are combining with it). your "key"
in user+key@domain should be in its own column and given a well fitted name
that describes briefly what "key" is.


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 06h28.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06689 seconds with 10 queries