Checking a Column

Codes here !

Moderators: egami, macek, gesf

Post Reply
Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Sat Sep 07, 2002 6:58 am

I made a script that will add new users to my db but I first want it to check the entire column to see if the username exists. Is there any specific function that would be good or should I just make a loop to go through each row?

Jay

Sun Sep 08, 2002 1:46 am

select count(*) from usersTable where username='$user'

Jay

Sun Sep 15, 2002 5:28 pm

I wouldn't use the address as a way of checking the data, since addresses can be miss-spelled etc. It would have to be exactly right for a match to occur. Better to pick one thing that won't change (like an email address) and use that to search for a matching record

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Yahoo [Bot] and 3 guests