SA-MP Forums Archive
[SQL-WEIRD][Print]Come explain please - 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-WEIRD][Print]Come explain please (/showthread.php?tid=570454)



[SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

hey my code

PHP Code:
stock SaveHouse(id)
{
    if(!
Iter_Contains(Housesid)) return 0;
    
mysql_format(gSQLHandlequerysizeof(query), "UPDATE houses SET HouseName='%s', HouseOwner='%s', HousePassword='%s', HouseLock=%d, HouseMoney=%d, LastEntered=%d WHERE ID=%d",
    
HouseData[id][Name], HouseData[id][Owner], HouseData[id][Password], HouseData[id][LockMode], HouseData[id][SafeMoney], HouseData[id][LastEntered], id);
    
mysql_tquery(gSQLHandlequery"""");
    
HouseData[id][Save] = false;
    return 
1;

This not work i meant it not save but when i put the print like this

PHP Code:
stock SaveHouse(id)
{
    if(!
Iter_Contains(Housesid)) return 0;
    
mysql_format(gSQLHandlequerysizeof(query), "UPDATE houses SET HouseName='%s', HouseOwner='%s', HousePassword='%s', HouseLock=%d, HouseMoney=%d, LastEntered=%d WHERE ID=%d",
    
HouseData[id][Name], HouseData[id][Owner], HouseData[id][Password], HouseData[id][LockMode], HouseData[id][SafeMoney], HouseData[id][LastEntered], id);
    print(
query); //<<<< here
    
mysql_tquery(gSQLHandlequery"""");
    
HouseData[id][Save] = false;
    return 
1;

It Workkk(it saved) when i put the print like this

i don't really know why can someone explain this please i get confused over it


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

Bumping never seen problemm!!!!!!!!!!!!!!


AW: [SQL-WEIRD][Print]Come explain please - Mencent - 10.04.2015

Work this so?
PHP Code:
stock SaveHouse(id)
{
    if(!
Iter_Contains(Housesid)) return 0;
    
mysql_format(gSQLHandlequerysizeof(query), "UPDATE houses SET HouseName='%s', HouseOwner='%s', HousePassword='%s', HouseLock=%d, HouseMoney=%d, LastEntered=%d WHERE ID=%d",
    
HouseData[id][Name], HouseData[id][Owner], HouseData[id][Password], HouseData[id][LockMode], HouseData[id][SafeMoney], HouseData[id][LastEntered], id);
    
HouseData[id][Save] = false;
    
mysql_tquery(gSQLHandlequery"""");
    return 
1;

Mencent


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

wait


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

nope not workkkkk

Quote:

stock SaveHouse(id)
{
if(!Iter_Contains(Houses, id)) return 0;
mysql_format(gSQLHandle, query, sizeof(query), "UPDATE houses SET HouseName='%s', HouseOwner='%s', HousePassword='%s', HouseLock=%d, HouseMoney=%d, LastEntered=%d WHERE ID=%d",
HouseData[id][Name], HouseData[id][Owner], HouseData[id][Password], HouseData[id][LockMode], HouseData[id][SafeMoney], HouseData[id][LastEntered], id);
print(query); //<<<< here
mysql_tquery(gSQLHandle, query, "", "");
HouseData[id][Save] = false;
return 1;
}

This still work with no reason


AW: [SQL-WEIRD][Print]Come explain please - Mencent - 10.04.2015

Hmm, sorry, I do not know the solution then, but you can leave it so ^^
Maybe someone else knows the answer.

Mencent


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

bumppppp


Re: [SQL-WEIRD][Print]Come explain please - Misiur - 10.04.2015

Could you show your mysql log contents after running that function?


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 10.04.2015

ok i'll show


Re: [SQL-WEIRD][Print]Come explain please - SequenceCuz - 11.04.2015

Quote:
Originally Posted by Misiur
View Post
Could you show your mysql log contents after running that function?
Console input: exit
[16:29:04] --- Server Shutting Down.
[16:29:04] UPDATE houses SET HouseName='House For Sale', HouseOwner='Bug_Findsss', HousePassword='2345', HouseLock=1, HouseMoney=0, LastEntered=1428658112 WHERE ID=0
[16:29:04] UPDATE houses SET HouseName='House For Sale', HouseOwner='Bug_Findsss', HousePassword='-', HouseLock=0, HouseMoney=0, LastEntered=1428658138 WHERE ID=1
[16:29:04] UPDATE houses SET HouseName='House For Sale', HouseOwner='-', HousePassword='-', HouseLock=0, HouseMoney=0, LastEntered=0 WHERE ID=2