MYSQL HELP !! +REP
#1

Hello , i recently downloaded a server called LGG , the script tooks fine but i got a poplem in saving the groups. Here the codes.
PHP код:
forward Group_Save(iGroupID); public Group_Save(iGroupID) {
    if(!(
0 <= iGroupID < MAX_GROUPS)) // Array bounds check. Use it.
        
return 0;
    new
        
szQuery[2516],
        
i = 0;
    
format(szQuery, sizeof szQuery, "UPDATE `groups` SET \
        `Type` = %i, `Name` = '%s', `Allegiance` = %i, `SirenAccess` = %i, `Bug` = %i, `Chat` = %i, \
        `Radio` = %i, `DeptRadio` = %i, `DutyColour` = %i, `RadioColour` = %i, `Stock` = %i, \
        `LockerX` = %.2f, `LockerY` = %.2f, `LockerZ` = %.2f, `LockerVW` = %i, `Share` = %i, \
        `HourlyPayment` = %i, `Editable` = %i, `Disabled` = %i"
,
    
GroupData[iGroupID][g_iGroupType], GroupData[iGroupID][g_szGroupName], GroupData[iGroupID][g_iAllegiance], GroupData[iGroupID][g_iBugAccess], GroupData[iGroupID][g_iSirenAccess],
    
GroupData[iGroupID][g_iChatAccess], GroupData[iGroupID][g_iRadioAccess], GroupData[iGroupID][g_iDeptRadioAccess], GroupData[iGroupID][g_hDutyColour], GroupData[iGroupID][g_hRadioColour], GroupData[iGroupID][g_iLockerStock],
    
GroupData[iGroupID][g_fLockerPos][0], GroupData[iGroupID][g_fLockerPos][1], GroupData[iGroupID][g_fLockerPos][2], GroupData[iGroupID][g_iLockerVW], GroupData[iGroupID][g_iShareAssets], GroupData[iGroupID][g_iGroupHourlyPayment],
    
GroupData[iGroupID][g_iEditable], GroupData[iGroupID][g_iDisabled]);
    for(
i = 0; i != MAX_GROUP_RANKS; ++i) format(szQuery, sizeof szQuery, "%s, `Rank%i` = '%s'", szQuery, i, GroupRanks[iGroupID][i]);
    for(
i = 0; i != MAX_GROUP_DIVS; ++i) format(szQuery, sizeof szQuery, "%s, `Div%i` = '%s'", szQuery, i, GroupDivisions[iGroupID][i]);
    for(
i = 0; i != MAX_GROUP_WEAPONS; ++i) format(szQuery, sizeof szQuery, "%s, `Gun%i` = %i, `Cost%i` = %i", szQuery, i, GroupData[iGroupID][g_iLockerGuns][i], i, GroupData[iGroupID][g_iLockerCost][i]);
    for(
i = 0; i != MAX_GROUP_RANKS; i++) format(szQuery, sizeof szQuery, "%s, `RankSkin%i` = %i", szQuery, i, GroupData[iGroupID][g_iRankSkin][i]);
    for(
i = 0; i != MAX_GROUP_RANKS; i++) format(szQuery, sizeof szQuery, "%s, `Rank%iPay` = %i", szQuery, i, GroupData[iGroupID][g_iGroupPay][i]);
    
format(szQuery, sizeof szQuery, "%s WHERE `id` = %i", szQuery, iGroupID + 1);
    return 
mysql_function_query(g_iConnectionHandle[0], szQuery, false, "OnQueryFinish", "i", THREAD_NO_RESULT);
} 
AND THE CMD THAT SAVE IS :

PHP код:
CMD:savegroup(playerid, params[])
{
    if(
PlayerData[playerid][pAdmin] >= 3)
    {
        new 
iGroupID, iIndex, string[128];
        if(
sscanf(params, "d", iGroupID)) return SendClientMessage(playerid, COLOR_GRAD1, SYNTAX_MESSAGE"/savegroup [group id]");
        
Group_Save(iGroupID);
        
format(string, sizeof(string), "Successfully saved Group ID: %s (%d)", GroupData[iGroupID][g_szGroupName], iGroupID);
        
SendClientMessage(playerid, COLOR_WHITE, string);
    }
    return 
1;
} 
My proplem that /savegroup [id] doesnt save to mysql , once i restart the server , everything is gone..

Please help
Reply
#2

Take a look at the mysql log if it doesn't save, it will give you a hint of what causes it or post it here.
Reply
#3

I don't think ,
Quote:

[21:14:48] [ERROR] ExecuteT[LoadLockers()] - (error #1146) Table 'lgg.viplockers' doesn't exist
[21:15:06] [WARNING] CMySQLResult::GetRowDataByName - field not found ("ForceChangePass")
[21:15:06] [ERROR] ExecuteT[OnQueryFinish(i)] - (error #1054) Unknown column 'playerGPCI' in 'field list'

Thats my mysql log , but i dont think it relates to groups in MYSQL , i think the proplem is from MYSQL reciving Data

Iam using Wamp Server (Localhost)
Reply
#4

Quote:
Originally Posted by MoemenWalid
Посмотреть сообщение
I don't think ,

Thats my mysql log , but i dont think it relates to groups in MYSQL , i think the proplem is from MYSQL reciving Data

Iam using Wamp Server (Localhost)
It clearly says the reason, the table does not exist.
Reply
#5

http://prntscr.com/5uic95

check this screenshot , I'm sure the table is done , i got it from the .sql file.

and i guess the mysql log says the viplocker doesnt exists not the groups.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)