IsUserNameAvailable doesn't work
#2

Thanks for your answer!

I'm new with MySQL, so it's possible that I make some stupid mistakes.

It's still not working, sometimes it shows that it does exist, and sometimes it shows that it doesn't exist.

Fuction
Код:
stock IsUserNameAvailable(playername[])
{
	format(query,sizeof(query),"SELECT COUNT(username) FROM `users` WHERE `username`='%s' limit 0,1;",playername);
	mysql_query(query);
	mysql_store_result();
	playername[0]=mysql_fetch_int();
	mysql_free_result();
	if(playername[0]==0)return 1;
	return 0;
}
Errors
Код:
[23:41:46] CMySQLHandler::Query(SELECT COUNT(username) FROM `users` WHERE `username`='BritishBoy' limit 0,1;) - An error has occured. (Error ID: 2013, Lost connection to MySQL server during query)

[23:41:46] >> mysql_store_result( Connection handle: 1 )

[23:41:46] CMySQLHandler::StoreResult() - No data to store.

[23:41:46] >> mysql_fetch_int( Connection handle: 1 )

[23:41:46] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)

[23:41:46] >> mysql_free_result( Connection handle: 1 )

[23:41:46] CMySQLHandler::FreeResult() - The result is already empty.
Reply


Messages In This Thread
IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 15:15
Re: IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 21:51
Re: IsUserNameAvailable doesn't work - by Sergei - 06.04.2011, 22:00
Re: IsUserNameAvailable doesn't work - by Voldemort - 06.04.2011, 22:01
Re: IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 22:26
Respuesta: IsUserNameAvailable doesn't work - by anonymousx - 07.04.2011, 19:43
Re: IsUserNameAvailable doesn't work - by BritishBoy - 08.04.2011, 09:44

Forum Jump:


Users browsing this thread: 1 Guest(s)