Questions ...

Results 1 to 9 of 9

Thread: Questions ...

  1. #1
    8575 Guest

    Default Questions ...

    1) Iam checking for an existing user name, if I find one I want to give the user two choices that are avalialbe and option to enter another user name.<BR><BR>Q1) The sql statement I&#039m using to find out if the user name is in the table selects ALL user names, this could take along time with millions of records. Is there a better way to check for this?<BR><BR>Q2) Any clues on how to create some userid that are not taken.<BR> (I dont want some crazy id, I would like to enter Alex and if it is taken get two choices like alex2000 or alex_99)<BR>thanks

  2. #2
    lagerBoy Guest

    Default RE: Questions ...

    1. You will have to check all records, so just ensure that you have indexed on the username field.<BR><BR>2. I think that you would have 2 choices here:<BR><BR>First you can check for the existance of the username and if exists return to the client and tell them to try again, mind you if they enter alex and alex1 - alex100 are already taken, they&#039re in for a long day.<BR><BR>Or, you can create the username dynamically for them!<BR><BR>How many users are there likely to be?<BR><BR>

  3. #3
    EDG Guest

    Default RE: Questions ...

    A1) "SELECT * FROM table WHERE Username IS Alex" is the best way to do this (that /I/ know of...)<BR><BR>A2) I&#039ll have to think about this for a while.

  4. #4
    8575 Guest

    Default RE: Questions ...

    Millions, thats why I want to create a dynamic user name like<BR>alex_99 or alex2000, but how do I know if it is taken and if it is taken

  5. #5
    Steve Cimino Guest

    Default RE: Questions ...

    Use a LIKE statement with wildcards, get all the potential names in an array, and compare. Generate 3 random suffixs that don&#039t match in any elements of the array.

  6. #6
    lagerBoy Guest

    Default Millions of peaches.

    OK so you&#039re going to have millions of users.<BR><BR>The way I would probably do it is I&#039d be assigning the Usernames and I&#039d pick their last name say. I&#039d have another table that was just a list of last names with a counter and each time the last name was called for I&#039d increment the counter.

  7. #7
    lagerBoy Guest

    Default RE: Millions of peaches.

    I still spinning at the prospect of developing a site for millions of users. The last site developed by lagerBoy (to sell ingredient scripts for HomeBrewing kits) averaged 8 hits per day, until I stopped going there to check how many hits there had been :(<BR><BR>I think that you could probably allow the users to assign their own Username and store it in the database using their Username+theirEmail address as the Primary Key.<BR><BR>Can I ask what sort of Web app. it is you are building?

  8. #8
    8575 Guest

    Default APP I"M BUILDING

    app is for marketing company with millions of peaches

  9. #9
    lagerBoy Guest

    Default That sounds just Peachey too me.

    So did you like to Primary Key idea?

Posting Permissions

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