Problems getting comma separated values
#1

I want to store multiple values in one field in the MySQL database.

This is the way I am currently using to store data (convert to string and concatenate a comma)

PHP код:
for(new i = 0; i < 10; i++) {
        
Player[playerid][playerPmBlocks][i] = 0;
        
valstr(temp, Player[playerid][playerPmBlocks][i]);
        
strcat(blockstring, temp, sizeof(blockstring));
        
strcat(blockstring, ",", sizeof(blockstring));
    } 
This is my enum:
PHP код:
enum PlayerInfo {
    
playerPmBlocks[255]
};
new 
Player[MAX_PLAYERS][PlayerInfo]; 
When I get the data, I am using

PHP код:
cache_get_value(0, "ppmblocks", tempblocks, 255); 
Please tell me a way to remove these commas and store back into the array I am using in the enum.

Also, I am highly unsatisfied by this code. If you guys have any better way to do this, please let me know. This is an urgency.
Reply


Messages In This Thread
Problems getting comma separated values - by JaskaranSingh - 11.11.2018, 17:56
Re: Problems getting comma separated values - by Calisthenics - 11.11.2018, 18:04
Re: Problems getting comma separated values - by khRamin78 - 11.11.2018, 18:16
Re: Problems getting comma separated values - by khRamin78 - 11.11.2018, 18:43
Re: Problems getting comma separated values - by JaskaranSingh - 12.11.2018, 06:25

Forum Jump:


Users browsing this thread: 1 Guest(s)