Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2010, 01:38 PM
harkly harkly is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 26 harkly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 4 m 15 sec
Reputation Power: 0
Verify userID not already in use

What is the best way to verify that a userID is not allready being used?

I was thinking Javascript but can't find where it will check the DB.

I am using PHP, MySql

Reply With Quote
  #2  
Old January 29th, 2010, 12:50 AM
Catacaustic's Avatar
Catacaustic Catacaustic is offline
Code Monkey V. 0.9
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Location: A Land Down Under
Posts: 1,884 Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level)Catacaustic User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 14 h 1 m 42 sec
Reputation Power: 1798
It depends on when you want to perform the check. Basically, there's two ways to do it:

1. Check on form submission.

This is the easy one. Whenthe form is submitted, check in the database to make sure that the requested username doesn't already exist, and if it does show an error the same way that you would with the rest of your form validation.

2. Check when entered.

To do this, you can use an AJAX query to get a response from the server and display this to the user when they are still on the page. It still needs to do the same thing of checking in the database to see if the username has been used before, but may help with the overhead of submitting the full form each time.

Reply With Quote
  #3  
Old January 29th, 2010, 07:23 AM
harkly harkly is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 26 harkly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 4 m 15 sec
Reputation Power: 0
Thanks, I did find an Ajax code that does this!

Reply With Quote
  #4  
Old August 14th, 2010, 10:22 AM
ScriptGuru ScriptGuru is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 10 ScriptGuru User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 36 sec
Reputation Power: 0
Quote:
What is the best way to verify that a userID is not allready being used?


in ur mysql you should have userID as incremental which each time you insert new data it will give them the next avail id

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Verify userID not already in use

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap