General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 13th, 2003, 08:29 PM
Cpaulv Cpaulv is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 Cpaulv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
signup form problems

i have a signup form made by a php form generator and that works fine with the database but i need it to also check to make sure that what the user types in for their username isn't already in the database table, i need to know how to get it to check the database table to make sure that no 2 users signup with the same username.
thx in advance.

Reply With Quote
  #2  
Old May 13th, 2003, 10:08 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
Find some tutorials on form validation. I think there might even be something on this site.

Briefly, what you need to do is:

PHP Code:
 $usercount_query "SELECT name FROM users WHERE name = '{$_POST['name']}' ";
$usercount mysql_query($usercount);
if (
mysql_num_rows($usercount) = 0) {
  
// INSERT new name
} else {
  
// Warn of duplicate name


Reply With Quote
  #3  
Old May 13th, 2003, 11:30 PM
Cpaulv Cpaulv is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 Cpaulv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
man i'm in way over my head, see i've never coded in PHP before, hence the form generator, i've coded in java and i'm not too bad in that but this is like totally new to me and i don't understand what is going on, if i give you the php file would someone be able to encorporate the code that i need into it?

Reply With Quote
  #4  
Old May 14th, 2003, 07:19 PM
Cpaulv Cpaulv is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 Cpaulv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
here are the files, in a zip file: myform.zip

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > signup form problems


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT