06.04.2011, 22:26
Thank!, but it doesn't fix the bug
Код:
stock IsUserNameAvailable(playername[]) { new esc[24],query2[256]; mysql_real_escape_string(playername,esc); format(query2,sizeof(query2),"SELECT COUNT(username) FROM `users` WHERE `username`='%s'",esc); mysql_query(query2); mysql_store_result(); if(mysql_fetch_int() > 0) { return 0; } else { return 1; } }
Код:
[00:20:01] CMySQLHandler::Query(SELECT COUNT(username) FROM `users` WHERE `username`='TestName') - An error has occured. (Error ID: 2013, Lost connection to MySQL server during query) [00:20:01] >> mysql_store_result( Connection handle: 1 ) [00:20:01] CMySQLHandler::StoreResult() - No data to store. [00:20:01] >> mysql_fetch_int( Connection handle: 1 ) [00:20:01] CMySQLHandler::FetchRow() - You cannot call this function now. (Reason: Empty Result)