[HELP] MySQL Loading Issue
#1

So I'm converting a group system into MySQL, and I have this function (that is calling correctly, I have checked that.)

pawn Код:
public InitiateGroups()
{

    new rows, row, fields, number[25];
   
    cache_get_data(rows, fields);
    while(row < rows)
    {        
        cache_get_field_content_int(row, "GroupType", Group[row][GroupType]);
        cache_get_field_content(row, "GroupName", Group[row][GroupName], 256);
        cache_get_field_content(row, "MOTD", Group[row][GroupMOTD], 256);

        for(new i = 0; i != MAX_GROUP_RANKS; ++i)
        {
            format(number, sizeof number, "Rank%i", i);
            cache_get_field_content(row, number, GroupRankNames[row][i], 256);
        }
        for(new i = 0; i != MAX_GROUP_RANKS; ++i)
        {
            format(number, sizeof number, "RankPay%i", i);
            cache_get_field_content_int(row, number, Group[row][GroupPaycheque][i]);
        }
        for(new i = 0; i != 6; ++i)
        {
            format(number, sizeof number, "Div%i", i);
            cache_get_field_content(row, number, GroupDivisionNames[row][i], 256);
        }
        row++;
    }
    switch(row)
    {
        case 0: printf("[SCRIPT-LOAD/ERR] The script initiated 0 groups.", row);
        default: printf("[SCRIPT-LOAD] The script has initiated %d groups", row);
    }
}
The issue is, it is not loading the GroupName, at least it isn't when I display the group dialog. It won't show up and I have to set it again. I checked the database and it saves in there, which means I believe it to be a loading issue.

Any thoughts? (REP+)
Reply
#2

I've had this problem also. I found that loading it into a temp string then formatting the value from the temp string works. Like this:
pawn Код:
cache_get_field_content(i, "owner", temp_string);
        format(businessData[i][bowner], 128, "%s", temp_string);
Reply
#3

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
I've had this problem also. I found that loading it into a temp string then formatting the value from the temp string works. Like this:
pawn Код:
cache_get_field_content(i, "owner", temp_string);
        format(businessData[i][bowner], 128, "%s", temp_string);
I had to complete the parameters with the connection handle and the string length before it would work. Odd, isn't it? Thank you though.
Reply
#4

PHP код:
cache_get_field_content(row"GroupName"Group[row][GroupName], connectionHandle256); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)