Re: Chec db if username is already there
| From: | Gary | Date: | Thu, 19 Oct 2000 17:40:45 +0000 |
| Subject: | Re: Chec db if username is already there | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21214@lists.php.net to get a copy of this message | ||
Thanks to everyone for the help. I do have a follow up question. I am testing
this on a in-house test server, without mail. If I want to test live I have to
change everything to php. Before I do that should I move the mail() after the
sql to prevent it from being sent until the check for username is finished?
Gary
David Robley wrote:
> On Thu, 19 Oct 2000, Gary wrote:
> > Hello,
> > I am fairly new to php and need some help. I have written a sign-up and
> > need to find out if the user name and or the email address are already
> > in the database.
>
> Just do a query on the table along the lines of SELECT COUNT(*) AS num FROM
> table WHERE username = '$username' and check the returned value of num; if
> it is zero the anme doesn't exist, otherwise it does.
>
> --
> David Robley | WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES |
> http://www.nisu.flinders.edu.au/
> AusEinet |
> http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA