MYSQL question
#1

How to check if the name is already registered?
Reply
#2

Perform a select query with a where clause of their username, then use mysql_num_rows to check how many rows were returned.

pawn Код:
mysql_query("SELECT username FROM users WHERE username = 'Calgon'");
mysql_store_result();
if(mysql_num_rows() > 0) {
// User exists
}
else {
// User does not exist
}
mysql_free_result();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)