saving problem in mysql
#1

stock SaveAccount(playerid)
{
new
query[300],
Floatos[4],
Float:health;

GetPlayerPos(playerid, posArr{pos});
GetPlayerFacingAngle(playerid, pos[3]);
GetPlayerHealth(playerid, health);

format(query, sizeof(query), "UPDATE `users` SET health = %.1f, X = %.2f, Y = %.2f, Z = %.2f, A = %.2f, interior = %d, vw = %d, skin = %d WHERE `id` = %d",
health,
posArrEx{pos},
GetPlayerInterior(playerid),
GetPlayerVirtualWorld(playerid),
GetPlayerSkin(playerid),
g_PlayerInfo[playerid][pSQLid]
);

mysql_function_query(g_Handle, query, false, "SendQuery", "");
return 1;
}


that code isn't working properly i am trying to save the player stats but keeps not saving. the problem isnt loading because i see in the mysql db and i see that nothing is being saved.
Can you help me? thanks
Reply
#2

Open mysql_log and read the lines which are related to your above query. If something went wrong, then it would print it there.
Reply
#3

GET This today
[09:54:19] [ERROR] CMySQLQuery::Execute[SendQuery()] - (error #1054) Unknown column 'X' in 'field list'
[09:54:36] [ERROR] CMySQLQuery::Execute[SendQuery()] - (error #1054) Unknown column 'X' in 'field list'
[09:55:07] [ERROR] CMySQLQuery::Execute[SendQuery()] - (error #1054) Unknown column 'X' in 'field list'
[09:55:10] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('8')
[09:55:10] [ERROR] cache_get_row_float - invalid data type
[09:55:10] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('9')
[09:55:10] [ERROR] cache_get_row_int - invalid data type
[09:55:10] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('10')
[09:55:10] [ERROR] cache_get_row_int - invalid data type
[09:55:10] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('11')
[09:55:10] [ERROR] cache_get_row_int - invalid data type
[09:58:34] [ERROR] CMySQLQuery::Execute[SendQuery()] - (error #1054) Unknown column 'X' in 'field list'
Reply
#4

Like the log says; field X does not exists into your database. Open phpMyAdmin and create it.
Reply
#5

thanks i fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)