MySQL Help here PLEASE!
#1

Ok so I want to make a changename cmd, but the problem is I couldnt figure out how to check the database that if a name already exists the name isnt changed and an error message. How can I check if a username already exists in the mysql database?
Reply
#2

use mysql_num_rows to check if the row returns true or false.

example

pawn Код:
if(mysql_num_rows() == 1)
{
    //does exist
}
else if(mysql_num_rows() == 0)
{
    //does not exist
}

//or
new rows = mysql_num_rows();

if(rows)
{
    //does exist
}
else if(!rows)
{
    //does not exist
}
Reply
#3

e.e
lol I knew that :P Just made it already anyways thanks dude that's the second time you helped me and I cant rep you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)