SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2000
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm using a MySQL database to handle my member signups/logins... so was wondering, how do I make sure there aren't any duplicate signups?

    at the initial signup screen, I'm asking for first name, last name(I plan on using these as the username) password and email. Also, I have another column(ID) as my primary key.

    So, suppose I add address fields in here, how do I check to make sure a member doesn't register twice?

    Thanks,
    kankohi

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You can make the last name and first name fields a non-duplicable index and you can make the email address a non-duplicable index. Then when you go to add a record to the database you can look for whatever error code mySQL throws out for duplicate index's and tell them that their choice is already taken.

    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider

  3. #3
    RAGE
    SitePoint Community Guest
    well, you can do a
    SELECT * FROM table WHERE first_name='$first_name' && last_name='$last_name'

    if it returns any rows, you return an error message that the acct already exists.. if not, you then go ahead and create account

    ReviewDepot - search for hosts - get hosts to BID for YOUR business


    ------------------
    Vinay Sahni (vinay@kryogen.com), Coder .. specializing in php/mysql
    ( Realmz ) ( ReviewDepot ) ( . . : : k r y o g e n : : . . )

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2000
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aah, yes, forgot about that.... guess I was being lazy

    Thanks,
    kankohi


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •