MySQL how to check does information exists
#1

Hello. I'm making MySQL register and login system. I made, that, if player is registering he have to enter his email and I don't know how to check, does that email which he entered exists in MySQL database.
Maybe someone can help me?
Thanks!
Reply
#2

What version of MySQL are you using ?
Reply
#3

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
What version of MySQL are you using ?
R7
Reply
#4

Use that function : mysql_num_rows()
Reply
#5

Quote:
Originally Posted by Dutheil
Посмотреть сообщение
Use that function : mysql_num_rows()
Humm.. But how should I check?

Could you give example? I'll give you +rep
Reply
#6

Put a unique key on the e-mail address column. Then just insert. If it comes back with a duplicate key error (catch in OnQueryError) you can just handle it there. Saves you one select query.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)