JAGF - Just A General Forum

It is currently Jan 6th, '09, 07:53 • All times are UTC + 1 hour






Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [php][webdesign][4]-check if e-mail/username already registe
PostPosted: Nov 1st, '08, 22:32 
Offline
New Gamer

Joined: Oct 31st, '08, 14:28
Posts: 42
Highscores: 24
How did you find this forum?: x10 forums
When you input data you don;t want to have the same name or id of a row (if you didn't do it purposely)
TO check if there already one email or name you need to select first

$result = db_query("SELECT id FROM users WHERE email='" . mysql_real_escape_string($email) . "'");
if (mysql_num_rows($result) > 0)
$error_string .= 'That email address is already registerd.<br>';

What i did is select id id is one of the most best way to organize your user each user have it id which is like id 1 2 3.... and it count up when a new user register... so in this here select id from users table and where email is the same as the one trying to register ( i repeat it can select -- the email from database-- is the same as -- the one user put in -- in REGISTER html form..) hope you get it.. and so if php can select that mean it already register .

and if select more then 0 that what >0 mean more then 0 ( there won't be more then one if everytime someone register have check to see if email already register **but sometime admin will create different accout for the same email <i don't know but more then 0 will be work for MOST of the people...>

I hope you read what i said :) because if you really want to learn PHP this stuff are important these are what i learn from experience so it is a short cut for you...
_________________
Image


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.

Design by phpBB 3 Skins & Forum Hosting | Modded by ExchangeCore

CSS Template by RamblingSoul | Sponsored By Bargain Finder