The house is already bought but its not!? D:
#7

PHP код:
function BuyHouse(playerid)
{
    new 
query[400],label[150];
    new 
houseid GetHouseID(playerid);
    
HouseInfo[houseid][HOwned] = true;
    
mysql_format(mysql,query,sizeof(query),"UPDATE `houses` SET `HOwnerID`= '%d', SET `HOwned` = 1 WHERE `hID` = '%d'",pinfo[playerid][ID],HouseInfo[houseid][hID]);
    
mysql_query(mysql,query);
    
format(label,sizeof(label),""COL_GREEN"HouseName"COL_WHITE":%s\n"COL_GREEN"",HouseInfo[houseid][HName]);
    
UpdateDynamic3DTextLabelText(HouseInfo[houseid][H3D],COLOR_YELLOW,label);
    return 
1;

Changed it as you said
though it doesnt update the table since there is a syntax according to mysql_log
pawn Код:
01:32:56] [DEBUG] mysql_format - connection: 1, len: 200, format: "UPDATE `houses` SET `HName` = '%s' WHERE `hID` = '%d'"
[01:32:56] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `houses` SET `HName` = 'test' WHERE `hID` = '0'", callback: "(null)", format: "(null)"
[01:32:56] [DEBUG] mysql_format - connection: 1, len: 400, format: "UPDATE `houses` SET `HOwnerID`= '%d', SET `HOwned` = 1 WHERE `hID` = '%d'"
[01:32:56] [DEBUG] mysql_query - connection: 1, query: "UPDATE `houses` SET `HOwnerID`= '1', SET `HOwned` = 1 WHERE `hID", use_cache: true
[01:32:56] [DEBUG] CMySQLQuery::Execute - starting query execution
[01:32:56] [ERROR] CMySQLQuery::Execute - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET `HOwned` = 1 WHERE `hID` = '0'' at line 1
[01:32:56] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[01:32:56] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.451 milliseconds
[01:32:56] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
Also it says where `hid` = 0 but my 1st house starts from houseid 1 D:
Lot problems pff
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)