MySql help
#7

Quote:
Originally Posted by iLearner
Посмотреть сообщение
PHP код:
new query[70];
    
mysql_format(g_SQLquerysizeof query"UPDATE `players` SET `owner` = %d,`health` = %d WHERE `id` = %d LIMIT 1"Player[playerid][Owner],Player[playerid][Health], Player[playerid][ID]);
    
mysql_tquery(g_SQLquery""""); 
Health is NOT an integer! Also mysql_tquery doesn't need the "" if those parameters are empty as they are optional. See: https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_tquery

It's odd to me that there are no errors from this if it isn't saving...

Код:
new query[80];

mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `owner` = %d,`health` = %.1f WHERE `id` = %d LIMIT 1", Player[playerid][Owner], Player[playerid][Health], Player[playerid][ID]);
mysql_tquery(g_SQL, query);
Your Player[playerid][Health] variable is set as a float when declared, right? Also are you getting the player's health and storing it to that variable prior to this query being executed?
Reply


Messages In This Thread
MySql help - by akib - 24.05.2017, 09:07
Re: MySql help - by iLearner - 24.05.2017, 09:09
Re: MySql help - by akib - 25.05.2017, 07:33
Re: MySql help - by Lbaker - 25.05.2017, 07:51
Re: MySql help - by akib - 25.05.2017, 08:11
Re: MySql help - by Cadilab - 25.05.2017, 08:23
Re: MySql help - by Burridge - 25.05.2017, 08:33

Forum Jump:


Users browsing this thread: 1 Guest(s)