MySql Not Posting data
#1

MySql not uploading any data to database.

Here is the full code :
PHP код:
if(dialogid == DIALOG_PRICE)
    {
        if(
response)
        {
            new 
Float:tmp_x,Float:tmp_y,Float:tmp_z;
            
GetPlayerPos(playerid,tmp_x,tmp_y,tmp_z);
            new 
id;
            
id GetFreeBizID();
            
bInfo[id][b_selling] = 1;
            
bInfo[id][b_price] = strval(inputtext);
            
bInfo[id][b_x] = tmp_x;
            
bInfo[id][b_y] = tmp_y;
            
bInfo[id][b_z] = tmp_z;
            new 
query[512];
            
format(querysizeof(query),"INSERT INTO biz (b_x, b_y, b_z, b_intx, b_inty, b_intz, b_price, h_selling) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%i', '1')",bInfo[b_x],bInfo[b_y],bInfo[b_z],bInfo[b_intx],bInfo[b_inty],bInfo[b_intz],bInfo[b_price],bInfo[b_selling]);
            
mysql_function_query(dbhandlequerytrue"OnBizCreated""i"id);
            
UpdateBiz(id);
        }
        return 
1;
    } 
Everything working fine, it also show, but it's temporary. Not saving in database
Reply
#2

Do you have a MySQL database already?
Reply
#3

yes. Everything fine, just not posting data's on the fields
Reply
#4

Is this the NGG Script? and if so have you edited the mysql.pwn and OnDialogResponce.pwn
Reply
#5

Quote:
Originally Posted by Eric_White
Посмотреть сообщение
Is this the NGG Script?
nope i am own coding...
Reply
#6

This is an example of the OnDialogResponce

PHP код:
if(dialogid == DIALOG_PURCHASEVIP)
    {
        if(
response)
        {
            if(
PlayerInfo[playerid][pCredits] < GetPVarInt(playerid"VIPPrice"))
                return 
SendClientMessageEx(playeridCOLOR_GREY"You don't have enough credits to purchase this item. Visit shop.origin-gaming.net to purchase credits.");

            if(
PlayerInfo[playerid][pDonateRank] != 0)
                return 
SendClientMessageEx(playeridCOLOR_GREY"You already have VIP, please wait for it to expire.");

            if(
GetPVarType(playerid"VIPType") != 1)
                return 
SendClientMessageEx(playeridCOLOR_GREY"An error has occured, please try again.");


            
PlayerInfo[playerid][pDonateRank] = GetPVarInt(playerid"VIPType");
            
PlayerInfo[playerid][pTempVIP] = 0;
            
PlayerInfo[playerid][pBuddyInvited] = 0;
            
PlayerInfo[playerid][pVIPSellable] = 0;

            if(
PlayerInfo[playerid][pVIPM] == 0)
            {
                
PlayerInfo[playerid][pVIPM] = VIPM;
                
VIPM++;
            }

            if(
GetPVarType(playerid"VIPMonths"))
            {
                
PlayerInfo[playerid][pVIPExpire] = (2592000*GetPVarInt(playerid"VIPMonths"))+gettime();
            }
            else
            {
                
PlayerInfo[playerid][pVIPExpire] = 2592000+gettime();
            }

            
GivePlayerCredits(playerid, -GetPVarInt(playerid"VIPPrice"), 1);

            if(
GetPVarInt(playerid"VIPType") == 3)
                
PlayerInfo[playerid][pGVip] = 1;

            new 
VIPType[7];
            new 
szQuery[128];
            if(
GetPVarType(playerid"GoldRenewal"))
            {
                
AmountSold[1]++;
                
AmountMade[1] += GetPVarInt(playerid"VIPPrice");
                
VIPType "Gold";
                
//ShopItems[1][sMade] += GetPVarInt(playerid, "VIPPrice");
                
format(szQuerysizeof(szQuery), "UPDATE `sales` SET `TotalSold1` = '%d', `AmountMade1` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH"AmountSold[1], AmountMade[1]);
                
DeletePVar(playerid"GoldRenewal");
            }
            else
            {
                switch(
GetPVarInt(playerid"VIPType")) {
                    case 
1:
                    {
                        
VIPType "Bronze";
                        
AmountSold[3]++;
                        
AmountMade[3] += GetPVarInt(playerid"VIPPrice");
                        
//ShopItems[3][sSold]++;
                        //ShopItems[3][sMade] += GetPVarInt(playerid, "VIPPrice");
                        
format(szQuerysizeof(szQuery), "UPDATE `sales` SET `TotalSold3` = '%d', `AmountMade3` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH"AmountSold[3], AmountMade[3]);
                    }
                    case 
2:
                    {
                        
VIPType "Silver";
                        
AmountSold[2]++;
                        
AmountMade[2] += GetPVarInt(playerid"VIPPrice");
                        
//ShopItems[2][sSold]++;
                        //ShopItems[2][sMade] += GetPVarInt(playerid, "VIPPrice");
                        
format(szQuerysizeof(szQuery), "UPDATE `sales` SET `TotalSold2` = '%d', `AmountMade2` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH"AmountSold[2], AmountMade[2]);
                    }
                    case 
3:
                    {
                        
VIPType "Gold";
                        
AmountSold[0]++;
                        
AmountMade[0] += GetPVarInt(playerid"VIPPrice");
                        
//ShopItems[0][sSold]++;
                        //ShopItems[0][sMade] += GetPVarInt(playerid, "VIPPrice");
                        
format(szQuerysizeof(szQuery), "UPDATE `sales` SET `TotalSold0` = '%d', `AmountMade0` = '%d' WHERE `Month` > NOW() - INTERVAL 1 MONTH"AmountSold[0], AmountMade[0]);
                    }
                }
            }

            
mysql_function_query(MainPipelineszQueryfalse"OnQueryFinish""i"SENDDATA_THREAD);

            
format(stringsizeof(string), "You have purchased %s VIP (%d Month(s)) for %s credits."VIPType,GetPVarInt(playerid"VIPMonths"), number_format(GetPVarInt(playerid"VIPPrice")));
            
SendClientMessageEx(playeridCOLOR_CYANstring);

            
format(stringsizeof(string), "[VIP %i] [User: %s(%i)] [IP: %s] [Credits: %s] [VIP: %s(%d)] [Price: %s]"PlayerInfo[playerid][pVIPM], GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]), VIPType,GetPVarInt(playerid"VIPMonths"), number_format(GetPVarInt(playerid"VIPPrice")));
            
Log("logs/credits.log"string), Log("logs/setvip.log"string), print(string);
        }
        
DeletePVar(playerid"VIPPrice");
        
DeletePVar(playerid"VIPMonths");
        
DeletePVar(playerid"VIPType");
    } 
for one of the dialogs. Which links up to a mysql.pwn and uploads content into the mysql server. Can you post screenshots please.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)