MySQL Help
#1

I need help in this code I don't want in it any MySQL functions if you can change the "mysql_function_query" to another function because I don't like to use MySQL it crashes and bugs.

Here is the code

pawn Код:
Group_Save(iGroupID) {
    if(!(0 <= iGroupID < MAX_GROUPS)) // Array bounds check. Use it.
        return 0;

    new
        szQuery[2048],
        i = 0;

    format(szQuery, sizeof szQuery, "UPDATE `groups` SET \
        `Type` = %i, `Name` = '%s', `Allegiance` = %i, `Bug` = %i, `Chat` = %i, \
        `Radio` = %i, `DeptRadio` = %i, `DutyColour` = %i, `RadioColour` = %i, `Stock` = %i, \
        `LockerX` = %.2f, `LockerY` = %.2f, `LockerZ` = %.2f, `LockerVW` = %i, \
        `CrateX` = %.2f, `CrateY` = %.2f, `CrateZ` = %.2f, `Share` = %i"
,
    arrGroupData[iGroupID][g_iGroupType], arrGroupData[iGroupID][g_szGroupName], arrGroupData[iGroupID][g_iAllegiance], arrGroupData[iGroupID][g_iBugAccess], arrGroupData[iGroupID][g_iChatAccess],
    arrGroupData[iGroupID][g_iRadioAccess], arrGroupData[iGroupID][g_iDeptRadioAccess], arrGroupData[iGroupID][g_hDutyColour], arrGroupData[iGroupID][g_hRadioColour], arrGroupData[iGroupID][g_iLockerStock],
    arrGroupData[iGroupID][g_fLockerPos][0], arrGroupData[iGroupID][g_fLockerPos][1], arrGroupData[iGroupID][g_fLockerPos][2], arrGroupData[iGroupID][g_iLockerVW],
    arrGroupData[iGroupID][g_fCratePos][0], arrGroupData[iGroupID][g_fCratePos][1], arrGroupData[iGroupID][g_fCratePos][2], arrGroupData[iGroupID][g_iShareAssets]);

    for(i = 0; i != MAX_GROUP_RANKS; ++i) format(szQuery, sizeof szQuery, "%s, `Rank%i` = '%s'", szQuery, i, arrGroupRanks[iGroupID][i]);
    for(i = 0; i != MAX_GROUP_DIVS; ++i) format(szQuery, sizeof szQuery, "%s, `Div%i` = '%s'", szQuery, i, arrGroupDivisions[iGroupID][i]);
    for(i = 0; i != MAX_GROUP_WEAPONS; ++i) format(szQuery, sizeof szQuery, "%s, `Gun%i` = %i, `Cost%i` = %i", szQuery, i, arrGroupData[iGroupID][g_iLockerGuns][i], i, arrGroupData[iGroupID][g_iLockerCost][i]);
    format(szQuery, sizeof szQuery, "%s WHERE `id` = %i", szQuery, iGroupID + 1);
    return mysql_function_query(MainPipeline, szQuery, false, "OnQueryFinish", "ii", SENDDATA_THREAD, iGroupID);
}
Reply


Messages In This Thread
MySQL Help - by ahmedkoki - 22.02.2014, 01:43
Re: MySQL Help - by Mattakil - 22.02.2014, 02:09
Re: MySQL Help - by ahmedkoki - 22.02.2014, 02:11
Re: MySQL Help - by ahmedkoki - 22.02.2014, 12:35
Re: MySQL Help - by ahmedkoki - 22.02.2014, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)