SA-MP Forums Archive
saving problem in mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: saving problem in mysql (/showthread.php?tid=460359)



saving problem in mysql - caoraivoso3 - 28.08.2013

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


Re: saving problem in mysql - Konstantinos - 28.08.2013

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


Re: saving problem in mysql - caoraivoso3 - 28.08.2013

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'


Re: saving problem in mysql - Konstantinos - 28.08.2013

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


Re: saving problem in mysql - caoraivoso3 - 28.08.2013

thanks i fixed it.