View Single Post
Old 04/12/2019, 06:48 AM   #8
Calisthenics
High-roller
 
Join Date: May 2018
Posts: 1,065
Reputation: 172
Default Re: I need help with updating mysql from R5 to R41-4

`mysql_retrieve_row` moves to the next row pointer. In the code you posted, it does not make sense as only 1 row is returned. For multiple rows, replace it with the loop shown in the previous replies.

`mysql_fetch_field_row` fetches the data by its column name. Replace it with `cache_get_value_name_int`. Since only 1 row is returned, we said previously that `rowid` will be 0.
pawn Code:
cache_get_value_name_int(0, "Skin", SAVESKIN[ playerid ]);
// or overloaded macro that accepts either column index or column name:
// cache_get_value_int(0, "Skin", SAVESKIN[ playerid ]);

This is also wrong:
Code:
format(Query, sizeof(Query), "SELECT * FROM `players` WHERE Name= '%s'", GetPlayerName(playerid));
`GetPlayerName` does not return the name, it is passed by reference: https://wiki.sa-mp.com/wiki/Function:GetPlayerName
It should have given warning 202 for wrong number of arguments.
Calisthenics is offline   Reply With Quote