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(!(
<= iGroupID MAX_GROUPS)) // Array bounds check. Use it.
        
return 0;
    new
        
szQuery[2516],
        
0;
    
format(szQuerysizeof 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(
0!= MAX_GROUP_RANKS; ++iformat(szQuerysizeof szQuery"%s, `Rank%i` = '%s'"szQueryiGroupRanks[iGroupID][i]);
    for(
0!= MAX_GROUP_DIVS; ++iformat(szQuerysizeof szQuery"%s, `Div%i` = '%s'"szQueryiGroupDivisions[iGroupID][i]);
    for(
0!= MAX_GROUP_WEAPONS; ++iformat(szQuerysizeof szQuery"%s, `Gun%i` = %i, `Cost%i` = %i"szQueryiGroupData[iGroupID][g_iLockerGuns][i], iGroupData[iGroupID][g_iLockerCost][i]);
    for(
0!= MAX_GROUP_RANKSi++) format(szQuerysizeof szQuery"%s, `RankSkin%i` = %i"szQueryiGroupData[iGroupID][g_iRankSkin][i]);
    for(
0!= MAX_GROUP_RANKSi++) format(szQuerysizeof szQuery"%s, `Rank%iPay` = %i"szQueryiGroupData[iGroupID][g_iGroupPay][i]);
    
format(szQuerysizeof szQuery"%s WHERE `id` = %i"szQueryiGroupID 1);
    return 
mysql_function_query(g_iConnectionHandle[0], szQueryfalse"OnQueryFinish""i"THREAD_NO_RESULT);

AND THE CMD THAT SAVE IS :

PHP код:
CMD:savegroup(playeridparams[])
{
    if(
PlayerData[playerid][pAdmin] >= 3)
    {
        new 
iGroupIDiIndexstring[128];
        if(
sscanf(params"d"iGroupID)) return SendClientMessage(playeridCOLOR_GRAD1SYNTAX_MESSAGE"/savegroup [group id]");
        
Group_Save(iGroupID);
        
format(stringsizeof(string), "Successfully saved Group ID: %s (%d)"GroupData[iGroupID][g_szGroupName], iGroupID);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    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)