27.01.2016, 18:34
I'm wanting to fetch 'charges' from my sql table, and to attach many of them in one string, for example
Let's say these are the charges
CHAR_NAME, Hit and run, other variables
CHAR_NAME, Murder, other variables
And attach them to a string so if I printed the string it would return
'Hit and Run, Murder'
I've tried this so far:
for(new z = 0; z < cache_get_row_count(); z++)
{
cache_get_field_content(0, "Reason", list);
//format(list, sizeof(list), "%s", list);
strcat(charges, list);
}
SetPVarString(playerid, "mdcreturn", charges);
But it currently only returns:
'Hit and run, Hit and run' and not 'Hit and Run, Murder' as it should
Any help would be amazing
Let's say these are the charges
CHAR_NAME, Hit and run, other variables
CHAR_NAME, Murder, other variables
And attach them to a string so if I printed the string it would return
'Hit and Run, Murder'
I've tried this so far:
for(new z = 0; z < cache_get_row_count(); z++)
{
cache_get_field_content(0, "Reason", list);
//format(list, sizeof(list), "%s", list);
strcat(charges, list);
}
SetPVarString(playerid, "mdcreturn", charges);
But it currently only returns:
'Hit and run, Hit and run' and not 'Hit and Run, Murder' as it should
Any help would be amazing