MYSQL Problem
#1

pawn Код:
case GROUPVEH_QUERY_LOAD: {
            while(g < MAX_GROUPS) {
                while(v < MAX_GROUP_VEHICLES) {
                    cache_get_field_content(iIndex, "GroupID", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gGroupID] = strval(szResult);

                    cache_get_field_content(iIndex, "ModelID", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gModelID] = strval(szResult);

                    cache_get_field_content(iIndex, "Colour1", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gColour1] = strval(szResult);

                    cache_get_field_content(iIndex, "Colour2", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gColour2] = strval(szResult);

                    cache_get_field_content(iIndex, "RankRequired", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gVehRankReq] = strval(szResult);

                    cache_get_field_content(iIndex, "SpawnX", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gVehSpawn][0] = floatstr(szResult);

                    cache_get_field_content(iIndex, "SpawnY", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gVehSpawn][1] = floatstr(szResult);

                    cache_get_field_content(iIndex, "SpawnZ", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gVehSpawn][2] = floatstr(szResult);

                    cache_get_field_content(iIndex, "SpawnA", szResult, iConnectionHandle);
                    GroupVehicles[g][v][gVehSpawn][3] = floatstr(szResult);

                    if(GroupVehicles[g][v][gModelID] != 0) {
                        GroupVehicles[g][v][gVehID] = CreateVehicle(GroupVehicles[g][v][gModelID], GroupVehicles[g][v][gVehSpawn][0], GroupVehicles[g][v][gVehSpawn][1], GroupVehicles[g][v][gVehSpawn][2], GroupVehicles[g][v][gVehSpawn][3], GroupVehicles[g][v][gColour1], GroupVehicles[g][v][gColour2], 3600);
                    }

                    g++;
                    v++;

                }
            }
        }
Is my code to load vehicles, it loads them but it loads the MAX_GROUPS which is 12.

So, basically - It find's the ONE car in the database, and loads it TWELVE times - The MAX_GROUPS is defined as 12, so must be that - But I don't know why it loads/spawns it 12 times?

pawn Код:
mysql_function_query(iConnectionHandle, "SELECT * FROM `groupvehicles`", true, "returnGroup_QueryFinish", "i", GROUPVEH_QUERY_LOAD);
load code ^^
Reply


Messages In This Thread
MYSQL Problem - by MattSlater - 14.01.2013, 06:44
Re: MYSQL Problem - by 3ventic - 14.01.2013, 06:54
Re: MYSQL Problem - by MattSlater - 14.01.2013, 15:22
Re: MYSQL Problem - by MattSlater - 14.01.2013, 17:13
Re: MYSQL Problem - by MattSlater - 14.01.2013, 20:23

Forum Jump:


Users browsing this thread: 1 Guest(s)