Mysql errors
#2

Look at the commentary below, please.
Код:
mysql_query(query);
mysql_store_result();
format(query, sizeof(query),"SELECT `id` FROM `playerinfo` WHERE `user`='%s' LIMIT 1",escpname);
mysql_fetch_int("id",gPlayerInfo[playerid][pDBID]); //This expression wants to fetch the id of a query which wasn't sent at this moment, because the query will be sent not until the next line.
mysql_query(query);
mysql_store_result();
Do it like this:

Код:
mysql_query(query);
mysql_store_result();
format(query, sizeof(query),"SELECT `id` FROM `playerinfo` WHERE `user`='%s' LIMIT 1",escpname);
mysql_query(query);
mysql_store_result();
mysql_fetch_int("id",gPlayerInfo[playerid][pDBID]);
mysql_free_result();
And remove the mysql_store_result() line after the INSERT INTO query, it won't be needed.
Reply


Messages In This Thread
Mysql errors - by RafaelZam - 03.05.2015, 02:04
AW: Mysql errors - by JackBauer1994 - 03.05.2015, 02:51
Respuesta: Mysql errors - by RafaelZam - 03.05.2015, 03:02

Forum Jump:


Users browsing this thread: 1 Guest(s)