SA-MP Forums Archive
SQL won't save some data of house and food stall - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SQL won't save some data of house and food stall (/showthread.php?tid=509989)



SQL won't save some data of house and food stall - Mavis100 - 29.04.2014

Код:
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicBiz) - Data being passed to ProcessTick().
[13:46:17] [DEBUG] LoadDynamicBiz() - Callback is being called...
[13:46:17] [DEBUG] >> cache_get_data(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion.
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion.
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [ERROR] >> cache_get_row_int(...) - An error occured during the datatype conversion.
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:17] [DEBUG] ProcessTick() - The cache has been cleared.
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Executing query SELECT * FROM `foodstands`...
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Query was successful.
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Data caching enabled.
[13:46:17] [DEBUG] CMySQLHandler::StoreResult() - Result was stored.
[13:46:17] [DEBUG] CMySQLHandler::FreeResult() - Result was successfully freed.
[13:46:17] [DEBUG] ProcessQueryThread(LoadDynamicStands) - Data being passed to ProcessTick().
[13:46:17] [DEBUG] LoadDynamicStands() - Callback is being called...
[13:46:17] [DEBUG] >> cache_get_data(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_int(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [ERROR] >> cache_get_row_float(...) - An error occured during the datatype conversion.
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [DEBUG] >> cache_get_row_float(Connection handle: 1)
[13:46:18] [DEBUG] ProcessTick() - The cache has been cleared.
PHP код:
public LoadDynamicBiz()
{
    new 
rowsfields;
    new 
total 0;
    
cache_get_data(rowsfields);
    if(
rows)
    {
        while(
total rows)
        {
            
BizInfo[total][bizID] = cache_get_row_int(total0);
            
BizInfo[total][bizPosX] = cache_get_row_float(total1);
            
BizInfo[total][bizPosY] = cache_get_row_float(total2);
            
BizInfo[total][bizPosZ] = cache_get_row_float(total3);
            
BizInfo[total][bizExitX] = cache_get_row_float(total4);
            
BizInfo[total][bizExitY] = cache_get_row_float(total5);
            
BizInfo[total][bizExitZ] = cache_get_row_float(total6);
            
cache_get_row(total7BizInfo[total][bizName], dbHandle128);
            
cache_get_row(total8BizInfo[total][bizInfo], dbHandle128);
            
cache_get_row(total9BizInfo[total][bizEnterMSG], dbHandle128);
            
cache_get_row(total10BizInfo[total][bizOwner], dbHandle128);
            
BizInfo[total][bizOwned] = cache_get_row_int(total11);
            
BizInfo[total][bizLocked] = cache_get_row_int(total12);
            
BizInfo[total][bizPrice] = cache_get_row_int(total13);
            
BizInfo[total][bizLevelbuy] = cache_get_row_int(total14);
            
BizInfo[total][bizInterior] = cache_get_row_int(total15);
            
BizInfo[total][bizWorld] = cache_get_row_int(total16);
            
BizInfo[total][bizCash] = cache_get_row_int(total17);
            
BizInfo[total][bizType] = cache_get_row_int(total18),
            
BizInfo[total][bizEntrance] = cache_get_row_int(total19);
            
BizInfo[total][bizRadio] = cache_get_row_int(total20);
            
BizInfo[total][bizOn] = 1;
            
BizInfo[total][bizPickUp] = CreateDynamicPickup(12391BizInfo[total][bizPosX], BizInfo[total][bizPosY], BizInfo[total][bizPosZ], -1, -1, -1100.0);
            
total++;
        }
    }
    
format(msg,sizeof(msg), "Loaded %d dynamic businesses from MySQL."total);
    
printf(msg);
    return 
1

PHP код:
stock UpdateHouseInfo(houseid)
{
    new 
weapons[256];
    
FormatHouseWeapons(houseidweapons);
    
format(querysizeof(query), "UPDATE `houses` SET `owner` = '%s', `owned` = %d, `locked` = %d, `price`= %d, `levelbuy`= %d, `rentprice` = %d, `rentable` = %d, `interior` = %d, `world` = %d, `cash` = %d, `furnitures` = %d WHERE `id` = %d",
    
HouseInfo[houseid][hOwner],
    
HouseInfo[houseid][hOwned],
    
HouseInfo[houseid][hLocked],
    
HouseInfo[houseid][hPrice],
    
HouseInfo[houseid][hLevelbuy],
    
HouseInfo[houseid][hRentprice],
    
HouseInfo[houseid][hRentable],
    
HouseInfo[houseid][hInterior],
    
HouseInfo[houseid][hWorld],
    
HouseInfo[houseid][hCash],
    
HouseInfo[houseid][hFurnitures],
    
HouseInfo[houseid][hID]);
    
mysql_function_query(dbHandlequeryfalse"""");
    
format(querysizeof(query), "UPDATE `houses` SET `checkx` = %f, `checky` = %f, `checkz` = %f, `weapons` = '%s', `exitx` = %f, `exity` = %f, `exitz` = %f, `posx` = %f, `posy` = %f, `posz` = %f, `info` = '%s', `radio` = %d WHERE `id` = %d",
    
HouseInfo[houseid][hCheckPosX],
    
HouseInfo[houseid][hCheckPosY],
    
HouseInfo[houseid][hCheckPosZ],
    
weapons,
    
HouseInfo[houseid][hExitX],
    
HouseInfo[houseid][hExitY],
    
HouseInfo[houseid][hExitZ],
    
HouseInfo[houseid][hEntranceX],
    
HouseInfo[houseid][hEntranceY],
    
HouseInfo[houseid][hEntranceZ],
    
HouseInfo[houseid][hInfo],
    
HouseInfo[houseid][hRadio],
    
HouseInfo[houseid][hID]);
    
mysql_function_query(dbHandlequeryfalse"""");
    return 
1;
}
stock AddHouseToFile(houseidlevelpricehouseinfo[], Float:xFloat:yFloat:z)
{
    
format(querysizeof(query), "INSERT INTO `houses` (posx, posy, posz, checkx, checky, checkz, info, price, levelbuy, owned, owner, cash, rentprice, rentable, locked, radio) VALUES(%f, %f, %f, %f, %f, %f, '%s', %d, %d, %d, '%s', %d, %d, %d, %d, %d)",
    
xyz0.00.00.0houseinfopricelevel0"The State"00010);
    
mysql_function_query(dbHandlequerytrue"OnHouseInsert""d"houseid);
    return 
1;

I can't save and load the interior, world, info and exit position for house and bizz


Re: SQL won't save player's data and a part of database of house and business - mrtms - 29.04.2014

Check the mysql.log so we can get more information other than that. Cause that tells us nothing, if possible that is.


Re: SQL won't save player's data and a part of database of house and business - Mavis100 - 29.04.2014

Quote:
Originally Posted by mrtms
Посмотреть сообщение
Check the mysql.log so we can get more information other than that. Cause that tells us nothing, if possible that is.
Please press ur F5


Re: SQL won't save some data of house and food stall - Mriss - 29.04.2014

try increase the size of the query