Need help with mysql (syntax) again -
Edvukas - 09.03.2019
I need help with mysql syntax to update my mysql version to version r41-2
I can't compile these:
forward OnLoadFishingData(playerid);
public OnLoadFishingData(playerid)
{
if(cache_num_rows())
{
cache_get_value_name_int(0,"fishingRod", player_FishingData[playerid][fishingRod]);
cache_get_value_name_int(0,"fishingBait", player_FishingData[playerid][fishingBait]);
cache_get_value_name_int(0,"fishingFloat", player_FishingData[playerid][fishingFloat]);
cache_get_value_name_int(0,"fishesCaughtToday", PlayerDB[playerid][fishesCaughtToday]);
cache_get_value_name_int(0,"fishesMoneyToday", PlayerDB[playerid][fishesMoneyToday]);
for(new t = 0; t < MAX_FISH_TYPES; t++)
{
player_FishingData[playerid][fishCount][t] = cache_get_value_name(0,f("fishCount%d", t));
player_FishingData[playerid][fishAmount][t] = cache_get_value_name(0,f("fishAmount%d", t));
player_FishingData[playerid][fishBiggestSize][t] = cache_get_value_name(0,f("fishBiggestSize%d", t));
}
return true;
} it says:
PHP Code:
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
Re: Need help with mysql (syntax) again -
Edvukas - 10.03.2019
Someone can help me?
Re: Need help with mysql (syntax) again -
Kane - 10.03.2019
Why are you using
cache_get_value_name?
Anyway, if you're on the latest version, this is how you cache_get_value_name:
pawn Code:
new dest[128];
cache_get_value_name(0, "name", dest);
printf("The value in the column 'name' is '%s'.", dest);
Re: Need help with mysql (syntax) again -
Edvukas - 10.03.2019
Quote:
Originally Posted by Kane_
Why are you using cache_get_value_name?
Anyway, if you're on the latest version, this is how you cache_get_value_name:
pawn Code:
new dest[128]; cache_get_value_name(0, "name", dest); printf("The value in the column 'name' is '%s'.", dest);
|
I can't understand... I changed this line:
pawn Code:
player_FishingData[playerid][fishBiggestSize][t] = cache_get_value_name_int(0,f("fishBiggestSize%d", t));
to
pawn Code:
cache_get_value_name_int(t,f("fishBiggestSize%d", player_FishingData[playerid][fishBiggestSize][t]));
but still get same error.
Re: Need help with mysql (syntax) again -
JesterlJoker - 10.03.2019
mysql r41-2?
shouldn't it be like this?
PHP Code:
cache_get_value(0, "name", PlayerData[playetid][name], MAX_NAME);
Re: Need help with mysql (syntax) again -
Infin1ty - 10.03.2019
Quote:
Originally Posted by JesterlJoker
mysql r41-2?
shouldn't it be like this?
PHP Code:
cache_get_value(0, "name", PlayerData[playetid][name], MAX_NAME);
|
PHP Code:
cache_get_value_name(0, "name", PlayerData[playerid][name], MAX_PLAYER_NAME);
Hope I helped,
Re: Need help with mysql (syntax) again -
Edvukas - 10.03.2019
Should this:
pawn Code:
player_FishingData[playerid][fishCount][t] = cache_get_field_content_int(0, f("fishCount%d", t));
like be this
pawn Code:
cache_get_value_name(0, "fishBiggestSize%d", player_FishingData[playerid][fishBiggestSize][t], t);
?
Re: Need help with mysql (syntax) again -
solstice_ - 10.03.2019
pawn Code:
cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][user_kills]);
R40+. Why do you need
fishBiggestSize%d
What is "%d" doing at the end?
Re: Need help with mysql (syntax) again -
Edvukas - 10.03.2019
doesn't matter if %d or it isn't it anyway says
pawn Code:
warning 213: tag mismatch
Re: Need help with mysql (syntax) again -
JesterlJoker - 11.03.2019
you can also use format though.
Example:
PHP Code:
for(new i, j = MAX_SIZE; i < j; i++){
new stringParser[5 + 2]; // 5 = 4 characters + null then 2 integers since there are only 12 slots for guns. Just an example
format(stringParser, size of stringParser, "Guns%d", i); // parsing string from 0 to 11
cache_get_value(0, stringParser, PlayerData[playerid][guns][i]); // this might make errors, so if it does. Just add that error here. If not problem solved
}