06.04.2011, 21:51
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
Errors
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; }
Код:
[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.