[thelist] sql for mailing list verify

Drew Psconi comitque at hotmail.com
Thu Jul 25 20:34:01 CDT 2002


I'm using ASP but I see how that relates.  I figured there may be a SQL
command for it but I guess it doesn't matter as long as it works.  Thanks!

DP


----- Original Message -----
From: <NanHarbisonSmith at aol.com>
To: <thelist at lists.evolt.org>
Sent: Thursday, July 25, 2002 6:18 PM
Subject: Re: [thelist] sql for mailing list verify


> --
> [ Picked text/plain from multipart/alternative ]
> Is this in a web page, are you using ASP, PHP, something else? I don't use
> SQL for this, I use PHP and it is easy to do, but it depends on the
language.
>  I use this code in PHP, when members sign  up for a username and
password,
> where the username has to be unique:
>
> //see if the username is already in the db
> $Query1 = "SELECT USERNAME from $TableName where (USERNAME =
'$username')";
>
>
> $Result1 = mysql_db_query($DBName, $Query1, $Link);
>
> //if there is a match
> if (mysql_num_rows($Result1) > 0) {
>     $Row = mysql_fetch_array($Result1);
>
>     Print ("The user name <span class=\"bold\">$Row[USERNAME] is already
> taken, please choose a different username.</span><br>\n");
>
> Nan
>
> > I have a mailing list that people can add themselves to.  I need to
verify
> > if the email address already exists in the database before adding them
to
> > the mailing list.  Is there a simple way to use SQL for this?
> >
> > Something like 'IF NOT EXISTS 'bob at hotmail.com' THEN INSERT...etc'
> >
> > Thanks!
>
>
>
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>



More information about the thelist mailing list